diff --git a/bin/java-petstore-feign.json b/bin/java-petstore-feign.json index 5502ee3bbad..a131d93d1e1 100644 --- a/bin/java-petstore-feign.json +++ b/bin/java-petstore-feign.json @@ -1,4 +1,5 @@ { "library": "feign", + "java8": true, "artifactId": "swagger-petstore-feign" } diff --git a/bin/java-petstore-feign.sh b/bin/java-petstore-feign.sh index 160dbb46b1b..f1173d85a95 100755 --- a/bin/java-petstore-feign.sh +++ b/bin/java-petstore-feign.sh @@ -26,7 +26,7 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/Java/libraries/feign -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-feign.json -o samples/client/petstore/java/feign -DhideGenerationTimestamp=true" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-feign.json -o samples/client/petstore/java/feign -DhideGenerationTimestamp=true" echo "Removing files and folders under samples/client/petstore/java/feign/src/main" rm -rf samples/client/petstore/java/feign/src/main diff --git a/bin/java-petstore-google-api-client.sh b/bin/java-petstore-google-api-client.sh index 09c9e14139a..14c9fe19b5a 100755 --- a/bin/java-petstore-google-api-client.sh +++ b/bin/java-petstore-google-api-client.sh @@ -26,9 +26,10 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/Java/libraries/google-api-client -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-google-api-client.json -o samples/client/petstore/java/google-api-client -DhideGenerationTimestamp=true" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-google-api-client.json -o samples/client/petstore/java/google-api-client -DhideGenerationTimestamp=true" echo "Removing files and folders under samples/client/petstore/java/google-api-client/src/main" rm -rf samples/client/petstore/java/google-api-client/src/main find samples/client/petstore/java/google-api-client -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags +# TODO: uncomment the java commmand when the issue with this script is fixed, see https://github.com/swagger-api/swagger-codegen-generators/issues/52 +# java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-jersey1.sh b/bin/java-petstore-jersey1.sh index 7ba472365e1..27aa0f826ba 100755 --- a/bin/java-petstore-jersey1.sh +++ b/bin/java-petstore-jersey1.sh @@ -26,7 +26,7 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/Java -i modules/swagger-codegen/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 -i modules/swagger-codegen/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-java6.sh b/bin/java-petstore-jersey2-java6.sh index 8ab7c2c7ef4..3ce176f263e 100755 --- a/bin/java-petstore-jersey2-java6.sh +++ b/bin/java-petstore-jersey2-java6.sh @@ -31,4 +31,5 @@ ags="$@ generate --artifact-id swagger-petstore-jersey2-java6 -i modules/swagger echo "Removing files and folders under samples/client/petstore/java/jersey2/src/main" rm -rf samples/client/petstore/java/jersey2-java6/src/main find samples/client/petstore/java/jersey2-java6 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags +# TODO: uncomment the java commmand when the issue with this script is fixed, see https://github.com/swagger-api/swagger-codegen-generators/issues/52 +# java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-okhttp-gson-parcelable.sh b/bin/java-petstore-okhttp-gson-parcelable.sh index 60a0908fe93..53fafacf06c 100755 --- a/bin/java-petstore-okhttp-gson-parcelable.sh +++ b/bin/java-petstore-okhttp-gson-parcelable.sh @@ -26,8 +26,9 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson -i modules/swagger-codegen/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 -i modules/swagger-codegen/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 {} + -java $JAVA_OPTS -jar $executable $ags +# TODO: uncomment the java commmand when the issue with this script is fixed, see https://github.com/swagger-api/swagger-codegen-generators/issues/52 +# java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-okhttp-gson.sh b/bin/java-petstore-okhttp-gson.sh index ef57de98775..48808cf7223 100755 --- a/bin/java-petstore-okhttp-gson.sh +++ b/bin/java-petstore-okhttp-gson.sh @@ -26,8 +26,9 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson -i modules/swagger-codegen/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 -DhideGenerationTimestamp=true" +ags="$@ generate -i modules/swagger-codegen/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 -DhideGenerationTimestamp=true" rm -rf samples/client/petstore/java/okhttp-gson/src/main find samples/client/petstore/java/okhttp-gson -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags +# TODO: uncomment the java commmand when the issue with this script is fixed, see https://github.com/swagger-api/swagger-codegen-generators/issues/52 +# java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-retrofit2.sh b/bin/java-petstore-retrofit2.sh index 30cb805c3ec..1433002400d 100755 --- a/bin/java-petstore-retrofit2.sh +++ b/bin/java-petstore-retrofit2.sh @@ -26,7 +26,7 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-retrofit2.json -o samples/client/petstore/java/retrofit2 -DhideGenerationTimestamp=true" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-retrofit2.json -o samples/client/petstore/java/retrofit2 -DhideGenerationTimestamp=true" echo "Removing files and folders under samples/client/petstore/java/retrofit2/src/main" rm -rf samples/client/petstore/java/retrofit2/src/main diff --git a/bin/java-petstore-retrofit2rx.sh b/bin/java-petstore-retrofit2rx.sh index 4b9c6512b10..04da0496b8c 100755 --- a/bin/java-petstore-retrofit2rx.sh +++ b/bin/java-petstore-retrofit2rx.sh @@ -26,7 +26,7 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-retrofit2rx.json -o samples/client/petstore/java/retrofit2rx -DuseRxJava=true,hideGenerationTimestamp=true" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-retrofit2rx.json -o samples/client/petstore/java/retrofit2rx -DuseRxJava=true,hideGenerationTimestamp=true" echo "Removing files and folders under samples/client/petstore/java/retrofit2rx/src/main" rm -rf samples/client/petstore/java/retrofit2rx/src/main diff --git a/bin/java-petstore-retrofit2rx2.sh b/bin/java-petstore-retrofit2rx2.sh index 145d5a994fe..c8f30f8d3c3 100755 --- a/bin/java-petstore-retrofit2rx2.sh +++ b/bin/java-petstore-retrofit2rx2.sh @@ -26,7 +26,7 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-retrofit2rx2.json -o samples/client/petstore/java/retrofit2rx2 -DuseRxJava2=true,hideGenerationTimestamp=true" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-retrofit2rx2.json -o samples/client/petstore/java/retrofit2rx2 -DuseRxJava2=true,hideGenerationTimestamp=true" echo "Removing files and folders under samples/client/petstore/java/retrofit2rx2/src/main" rm -rf samples/client/petstore/java/retrofit2rx2/src/main diff --git a/bin/java-petstore-vertx.sh b/bin/java-petstore-vertx.sh index a2e9d9baa9a..9995d749acf 100755 --- a/bin/java-petstore-vertx.sh +++ b/bin/java-petstore-vertx.sh @@ -26,7 +26,7 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -t modules/swagger-codegen/src/main/resources/Java/libraries/vertx -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-vertx.json -o samples/client/petstore/java/vertx -DhideGenerationTimestamp=true" +ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-vertx.json -o samples/client/petstore/java/vertx -DhideGenerationTimestamp=true" echo "Removing files and folders under samples/client/petstore/java/vertx/src/main" rm -rf samples/client/petstore/java/vertx/src/main diff --git a/samples/client/petstore/java/feign/.swagger-codegen/VERSION b/samples/client/petstore/java/feign/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/client/petstore/java/feign/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/feign/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/feign/README.md b/samples/client/petstore/java/feign/README.md index d5d447e2865..debee3090f7 100644 --- a/samples/client/petstore/java/feign/README.md +++ b/samples/client/petstore/java/feign/README.md @@ -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..358023ebef4 100644 --- a/samples/client/petstore/java/feign/build.gradle +++ b/samples/client/petstore/java/feign/build.gradle @@ -32,8 +32,11 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_7 - targetCompatibility JavaVersion.VERSION_1_7 + + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + + } // Rename the aar correctly @@ -78,8 +81,8 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven' - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 install { repositories.mavenInstaller { @@ -96,23 +99,31 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.9" jackson_version = "2.8.7" + threepane_version = "2.6.4" + feign_version = "9.4.0" feign_form_version = "2.1.0" junit_version = "4.12" - oltu_version = "1.0.1" + oltu_version = "1.0.2" } dependencies { compile "io.swagger:swagger-annotations:$swagger_annotations_version" - compile "io.github.openfeign:feign-core:$feign_version" - compile "io.github.openfeign:feign-jackson:$feign_version" - compile "io.github.openfeign:feign-slf4j:$feign_version" + compile "com.netflix.feign:feign-core:$feign_version" + compile "com.netflix.feign:feign-jackson:$feign_version" + compile "com.netflix.feign:feign-slf4j:$feign_version" compile "io.github.openfeign.form:feign-form:$feign_form_version" compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" + + + compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + + compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$threepane_version" + compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" compile "com.brsanthu:migbase64:2.2" testCompile "junit:junit:$junit_version" diff --git a/samples/client/petstore/java/feign/build.sbt b/samples/client/petstore/java/feign/build.sbt index fac8ce229a7..532f1054f57 100644 --- a/samples/client/petstore/java/feign/build.sbt +++ b/samples/client/petstore/java/feign/build.sbt @@ -10,15 +10,15 @@ lazy val root = (project in file(".")). resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( "io.swagger" % "swagger-annotations" % "1.5.9" % "compile", - "io.github.openfeign" % "feign-core" % "9.4.0" % "compile", - "io.github.openfeign" % "feign-jackson" % "9.4.0" % "compile", - "io.github.openfeign" % "feign-slf4j" % "9.4.0" % "compile", + "com.netflix.feign" % "feign-core" % "9.4.0" % "compile", + "com.netflix.feign" % "feign-jackson" % "9.4.0" % "compile", + "com.netflix.feign" % "feign-slf4j" % "9.4.0" % "compile", "io.github.openfeign.form" % "feign-form" % "2.1.0" % "compile", "com.fasterxml.jackson.core" % "jackson-core" % "2.8.7" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.8.7" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.7" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.8.7" % "compile", - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.8.7" % "compile", + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2" % "compile", "com.brsanthu" % "migbase64" % "2.2" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" 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/AnimalFarm.md b/samples/client/petstore/java/feign/docs/AnimalFarm.md deleted file mode 100644 index c7c7f1ddcce..00000000000 --- a/samples/client/petstore/java/feign/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ - -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - 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/ModelReturn.md b/samples/client/petstore/java/feign/docs/ModelReturn.md deleted file mode 100644 index a679b04953e..00000000000 --- a/samples/client/petstore/java/feign/docs/ModelReturn.md +++ /dev/null @@ -1,10 +0,0 @@ - -# ModelReturn - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **Integer** | | [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/git_push.sh b/samples/client/petstore/java/feign/git_push.sh index ae01b182ae9..ed374619b13 100644 --- a/samples/client/petstore/java/feign/git_push.sh +++ b/samples/client/petstore/java/feign/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 credential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential 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/feign/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/feign/gradle/wrapper/gradle-wrapper.jar index 2c6137b8789..e69de29bb2d 100644 Binary files a/samples/client/petstore/java/feign/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/feign/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/feign/pom.xml b/samples/client/petstore/java/feign/pom.xml index c363308fa3b..24b520a8850 100644 --- a/samples/client/petstore/java/feign/pom.xml +++ b/samples/client/petstore/java/feign/pom.xml @@ -1,279 +1,272 @@ - 4.0.0 - io.swagger - swagger-petstore-feign - jar - swagger-petstore-feign - 1.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-petstore-feign + jar + swagger-petstore-feign + 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 - 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 + - - - 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 - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - 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-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.2 - - - - jar - test-jar - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - - - 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-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + + + 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-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 - - - - - - - - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + - - - io.swagger - swagger-annotations - ${swagger-core-version} - + + + io.swagger + swagger-annotations + ${swagger-core-version} + - - - io.github.openfeign - feign-core - ${feign-version} - - - io.github.openfeign - feign-jackson - ${feign-version} - - - io.github.openfeign - feign-slf4j - ${feign-version} - - - io.github.openfeign.form - feign-form - ${feign-form-version} - + + + io.github.openfeign + feign-core + ${feign-version} + + + io.github.openfeign + feign-jackson + ${feign-version} + + + io.github.openfeign + feign-slf4j + ${feign-version} + + + io.github.openfeign.form + feign-form + ${feign-form-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.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - ${oltu-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-threetenbp-version} + + + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + ${oltu-version} + - - - junit - junit - ${junit-version} - test - - - com.squareup.okhttp3 - mockwebserver - 3.6.0 - test - - - org.assertj - assertj-core - 1.7.1 - test - - - - UTF-8 - 1.7 - ${java.version} - ${java.version} - 1.5.15 - 9.4.0 - 2.1.0 - 2.8.9 - 2.6.4 - 4.12 - 1.0.0 - 1.0.1 - + + + junit + junit + ${junit-version} + test + + + com.squareup.okhttp3 + mockwebserver + 3.6.0 + test + + + org.assertj + assertj-core + 1.7.1 + test + + + + 1.8 + ${java.version} + ${java.version} + 1.5.15 + 9.4.0 + 2.1.0 + 2.8.9 + + 2.6.4 + + 4.12 + 1.0.0 + 1.0.2 + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java index 8fea4ac0ad9..3143f935f5c 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/ApiClient.java @@ -5,13 +5,21 @@ import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; + import org.threeten.bp.*; + import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; + + +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; + + import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; + import feign.Feign; import feign.RequestInterceptor; import feign.form.FormEncoder; @@ -42,19 +50,38 @@ public ApiClient() { public ApiClient(String[] authNames) { this(); for(String authName : authNames) { + RequestInterceptor auth; if ("api_key".equals(authName)) { + + auth = new ApiKeyAuth("header", "api_key"); + + } else if ("api_key_query".equals(authName)) { + + auth = new ApiKeyAuth("query", "api_key_query"); + + } else if ("http_basic_test".equals(authName)) { + auth = new HttpBasicAuth(); + + + } else if ("petstore_auth".equals(authName)) { - auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); + + + + auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", ""); + } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } addAuthorization(authName, auth); + + } } @@ -138,11 +165,17 @@ private ObjectMapper createObjectMapper() { objectMapper.disable(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE); objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); objectMapper.setDateFormat(new RFC3339DateFormat()); + + + objectMapper.registerModule(new JavaTimeModule()); + + ThreeTenModule module = new ThreeTenModule(); module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); objectMapper.registerModule(module); + return objectMapper; } 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..24bca18072a 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 @@ -3,12 +3,16 @@ import io.swagger.client.ApiClient; import io.swagger.client.EncodingUtils; + import io.swagger.client.model.Client; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import feign.*; @@ -18,13 +22,21 @@ 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") @Headers({ "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..258669033ee 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 @@ -3,16 +3,18 @@ import io.swagger.client.ApiClient; import io.swagger.client.EncodingUtils; + 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 java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import feign.*; @@ -22,114 +24,144 @@ public interface FakeApi extends ApiClient.Api { /** * * Test serialization of outer boolean types + * @param body 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); - + + /** * * 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); + + /** * * Test serialization of outer number types + * @param body Input number as post body (optional) + + * @return BigDecimal + + */ @RequestLine("POST /fake/outer/number") @Headers({ - "Content-Type: application/json", - "Accept: application/json", + "Content-Type: */*", + "Accept: */*", }) BigDecimal fakeOuterNumberSerialize(BigDecimal body); - + + /** * * Test serialization of outer string types + * @param body Input string as post body (optional) + + * @return String + + */ @RequestLine("POST /fake/outer/string") @Headers({ - "Content-Type: application/json", - "Accept: application/json", + "Content-Type: */*", + "Accept: */*", }) String fakeOuterStringSerialize(String body); - + + /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + + * @param client client model (required) + + * @return Client + + */ @RequestLine("PATCH /fake") @Headers({ "Content-Type: application/json", "Accept: application/json", }) - Client testClientModel(Client body); - + Client testClientModel(Client client); + + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) + + * @param body (required) + + + */ @RequestLine("POST /fake") @Headers({ "Content-Type: application/xml; charset=utf-8", - "Accept: application/xml; charset=utf-8,application/json; charset=utf-8", + "Accept: ", }) - 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(Object body); + + /** * 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 body (optional) + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + + * @param enumHeaderString Header parameter enum test (string) (optional) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + + * @param enumQueryString Query parameter enum test (string) (optional) + * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) + + + */ @RequestLine("GET /fake?enum_query_string_array={enumQueryStringArray}&enum_query_string={enumQueryString}&enum_query_integer={enumQueryInteger}") @Headers({ - "Content-Type: */*", - "Accept: */*", + "Content-Type: ", + "Accept: ", "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(Object body, @Param("enumHeaderStringArray") List enumHeaderStringArray, @Param("enumHeaderString") String enumHeaderString, @Param("enumQueryStringArray") List enumQueryStringArray, @Param("enumQueryString") String enumQueryString, @Param("enumQueryInteger") Integer enumQueryInteger); + /** * To test enum parameters @@ -139,70 +171,115 @@ 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 body (optional) + + + * @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 enumHeaderString Header 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)
  • + + *
  • enumQueryString - Query parameter enum test (string) (optional)
  • + *
  • enumQueryInteger - Query parameter enum test (double) (optional)
  • + *
+ + */ @RequestLine("GET /fake?enum_query_string_array={enumQueryStringArray}&enum_query_string={enumQueryString}&enum_query_integer={enumQueryInteger}") @Headers({ - "Content-Type: */*", - "Accept: */*", + "Content-Type: ", + "Accept: ", "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(Object body, @Param("enumHeaderStringArray") List enumHeaderStringArray, @Param("enumHeaderString") String enumHeaderString, @QueryMap(encoded=true) Map queryParams); /** * A convenience class for generating query parameters for the * testEnumParameters method in a fluent style. */ public static class TestEnumParametersQueryParams extends HashMap { + public TestEnumParametersQueryParams enumQueryStringArray(final List value) { - put("enum_query_string_array", EncodingUtils.encodeCollection(value, "csv")); + + + put("enum_query_string_array", EncodingUtils.encode(value)); + return this; } + public TestEnumParametersQueryParams enumQueryString(final String value) { + + put("enum_query_string", EncodingUtils.encode(value)); + return this; } + public TestEnumParametersQueryParams enumQueryInteger(final Integer value) { + + put("enum_query_integer", EncodingUtils.encode(value)); + return this; } + } - + + /** * test inline additionalProperties * - * @param param request body (required) + + * @param body request body (required) + + + */ @RequestLine("POST /fake/inline-additionalProperties") @Headers({ "Content-Type: application/json", - "Accept: application/json", + "Accept: ", }) - void testInlineAdditionalProperties(Object param); - + void testInlineAdditionalProperties(Map body); + + /** * test json serialization of form data * - * @param param field1 (required) - * @param param2 field2 (required) + + * @param body (required) + + + */ @RequestLine("GET /fake/jsonFormData") @Headers({ - "Content-Type: application/json", - "Accept: application/json", + "Content-Type: ", + "Accept: ", }) - void testJsonFormData(@Param("param") String param, @Param("param2") String param2); + void testJsonFormData(Object body); + + + } 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 de12108b769..25b3d6fb494 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 @@ -3,12 +3,16 @@ import io.swagger.client.ApiClient; import io.swagger.client.EncodingUtils; + import io.swagger.client.model.Client; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import feign.*; @@ -18,13 +22,21 @@ public interface FakeClassnameTags123Api extends ApiClient.Api { /** * To test class name in snake case * - * @param body client model (required) + + * @param client client model (required) + + * @return Client + + */ @RequestLine("PATCH /fake_classname_test") @Headers({ "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..f82cfad6c65 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 @@ -3,14 +3,17 @@ import io.swagger.client.ApiClient; import io.swagger.client.EncodingUtils; -import java.io.File; + import io.swagger.client.model.ModelApiResponse; import io.swagger.client.model.Pet; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import feign.*; @@ -20,39 +23,58 @@ 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", + "Accept: ", }) - void addPet(Pet body); - + void addPet(Pet pet); + + /** * Deletes a pet * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + + + */ @RequestLine("DELETE /pet/{petId}") @Headers({ - "Accept: application/json", + "Content-Type: application/json", + "Accept: ", "api_key: {apiKey}" }) - void deletePet(@Param("petId") Long petId, @Param("apiKey") String apiKey); - + void deletePet(@Param("petId") Integer petId, @Param("apiKey") String apiKey); + + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + + * @return List<Pet> + + */ @RequestLine("GET /pet/findByStatus?status={status}") @Headers({ + "Content-Type: ", "Accept: application/json", }) List findPetsByStatus(@Param("status") List status); + /** * Finds Pets by status @@ -62,15 +84,24 @@ public interface PetApi extends ApiClient.Api { * is convenient for services with optional query parameters, especially when * used with the {@link FindPetsByStatusQueryParams} class that allows for * building up this map in a fluent style. + + + * @param queryParams Map of query parameters as name-value pairs *

The following elements may be specified in the query map:

*
    + *
  • status - Status values that need to be considered for filter (required)
  • + *
+ * @return List<Pet> + + */ @RequestLine("GET /pet/findByStatus?status={status}") @Headers({ + "Content-Type: ", "Accept: application/json", }) List findPetsByStatus(@QueryMap(encoded=true) Map queryParams); @@ -80,23 +111,36 @@ public interface PetApi extends ApiClient.Api { * findPetsByStatus method in a fluent style. */ public static class FindPetsByStatusQueryParams extends HashMap { + public FindPetsByStatusQueryParams status(final List value) { - put("status", EncodingUtils.encodeCollection(value, "csv")); + + + put("status", EncodingUtils.encode(value)); + return this; } + } - + + /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + + * @return List<Pet> + + */ @RequestLine("GET /pet/findByTags?tags={tags}") @Headers({ + "Content-Type: ", "Accept: application/json", }) List findPetsByTags(@Param("tags") List tags); + /** * Finds Pets by tags @@ -106,15 +150,24 @@ public FindPetsByStatusQueryParams status(final List value) { * is convenient for services with optional query parameters, especially when * used with the {@link FindPetsByTagsQueryParams} class that allows for * building up this map in a fluent style. + + + * @param queryParams Map of query parameters as name-value pairs *

The following elements may be specified in the query map:

*
    + *
  • tags - Tags to filter by (required)
  • + *
+ * @return List<Pet> + + */ @RequestLine("GET /pet/findByTags?tags={tags}") @Headers({ + "Content-Type: ", "Accept: application/json", }) List findPetsByTags(@QueryMap(encoded=true) Map queryParams); @@ -124,62 +177,93 @@ public FindPetsByStatusQueryParams status(final List value) { * findPetsByTags method in a fluent style. */ public static class FindPetsByTagsQueryParams extends HashMap { + public FindPetsByTagsQueryParams tags(final List value) { - put("tags", EncodingUtils.encodeCollection(value, "csv")); + + + put("tags", EncodingUtils.encode(value)); + return this; } + } - + + /** * Find pet by ID * Returns a single pet + * @param petId ID of pet to return (required) + + * @return Pet + + */ @RequestLine("GET /pet/{petId}") @Headers({ + "Content-Type: ", "Accept: application/json", }) - Pet getPetById(@Param("petId") Long petId); - + Pet getPetById(@Param("petId") Integer petId); + + /** * 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", + "Accept: ", }) - void updatePet(Pet body); - + void updatePet(Pet pet); + + /** * Updates a pet in the store with form data * + * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) + + * @param body (optional) + + + */ @RequestLine("POST /pet/{petId}") @Headers({ "Content-Type: application/x-www-form-urlencoded", - "Accept: application/json", + "Accept: ", }) - void updatePetWithForm(@Param("petId") Long petId, @Param("name") String name, @Param("status") String status); - + void updatePetWithForm(@Param("petId") Integer petId, Object body); + + /** * uploads an image * + * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) + + * @param body (optional) + + * @return ModelApiResponse + + */ @RequestLine("POST /pet/{petId}/uploadImage") @Headers({ "Content-Type: multipart/form-data", "Accept: application/json", }) - ModelApiResponse uploadFile(@Param("petId") Long petId, @Param("additionalMetadata") String additionalMetadata, @Param("file") File file); + ModelApiResponse uploadFile(@Param("petId") Integer petId, Object body); + + + } 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..a571174d592 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 @@ -3,12 +3,16 @@ import io.swagger.client.ApiClient; import io.swagger.client.EncodingUtils; + import io.swagger.client.model.Order; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import feign.*; @@ -18,47 +22,74 @@ public interface StoreApi extends ApiClient.Api { /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + + + */ @RequestLine("DELETE /store/order/{orderId}") @Headers({ - "Accept: application/json", + "Content-Type: application/json", + "Accept: ", }) void deleteOrder(@Param("orderId") String orderId); - + + /** * Returns pet inventories by status * Returns a map of status codes to quantities + + * @return Map<String, Integer> + + */ @RequestLine("GET /store/inventory") @Headers({ + "Content-Type: ", "Accept: application/json", }) Map getInventory(); - + + /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + + * @return Order + + */ @RequestLine("GET /store/order/{orderId}") @Headers({ + "Content-Type: ", "Accept: application/json", }) - Order getOrderById(@Param("orderId") Long orderId); - + Order getOrderById(@Param("orderId") Integer orderId); + + /** * 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 3a6c3288195..8c17d0b245b 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 @@ -3,12 +3,16 @@ import io.swagger.client.ApiClient; import io.swagger.client.EncodingUtils; + import io.swagger.client.model.User; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import feign.*; @@ -18,74 +22,110 @@ 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", - "Accept: application/json", + "Content-Type: */*", + "Accept: ", }) - void createUser(User body); - + void createUser(User user); + + /** * Creates list of users with given input array * + * @param body List of user object (required) + + + */ @RequestLine("POST /user/createWithArray") @Headers({ - "Content-Type: application/json", - "Accept: application/json", + "Content-Type: */*", + "Accept: ", }) void createUsersWithArrayInput(List body); - + + /** * Creates list of users with given input array * + * @param body List of user object (required) + + + */ @RequestLine("POST /user/createWithList") @Headers({ - "Content-Type: application/json", - "Accept: application/json", + "Content-Type: */*", + "Accept: ", }) void createUsersWithListInput(List body); - + + /** * Delete user * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + + + */ @RequestLine("DELETE /user/{username}") @Headers({ - "Accept: application/json", + "Content-Type: application/json", + "Accept: ", }) void deleteUser(@Param("username") String username); - + + /** * Get user by user name * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + + * @return User + + */ @RequestLine("GET /user/{username}") @Headers({ + "Content-Type: ", "Accept: application/json", }) User getUserByName(@Param("username") String username); - + + /** * Logs user into the system * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + + * @return String + + */ @RequestLine("GET /user/login?username={username}&password={password}") @Headers({ + "Content-Type: ", "Accept: application/json", }) String loginUser(@Param("username") String username, @Param("password") String password); + /** * Logs user into the system @@ -95,16 +135,28 @@ public interface UserApi extends ApiClient.Api { * is convenient for services with optional query parameters, especially when * used with the {@link LoginUserQueryParams} class that allows for * building up this map in a fluent style. + + + + + * @param queryParams Map of query parameters as name-value pairs *

The following elements may be specified in the query map:

*
    + *
  • username - The user name for login (required)
  • + *
  • password - The password for login in clear text (required)
  • + *
+ * @return String + + */ @RequestLine("GET /user/login?username={username}&password={password}") @Headers({ + "Content-Type: ", "Accept: application/json", }) String loginUser(@QueryMap(encoded=true) Map queryParams); @@ -114,36 +166,59 @@ public interface UserApi extends ApiClient.Api { * loginUser method in a fluent style. */ public static class LoginUserQueryParams extends HashMap { + public LoginUserQueryParams username(final String value) { + + put("username", EncodingUtils.encode(value)); + return this; } + public LoginUserQueryParams password(final String value) { + + put("password", EncodingUtils.encode(value)); + return this; } + } - + + /** * Logs out current logged in user session * + + + */ @RequestLine("GET /user/logout") @Headers({ - "Accept: application/json", + "Content-Type: ", + "Accept: ", }) void logoutUser(); - + + /** * Updated user * This can only be done by the logged in user. + + * @param user Updated user object (required) + * @param username name that need to be deleted (required) - * @param body Updated user object (required) + + + */ @RequestLine("PUT /user/{username}") @Headers({ - "Content-Type: application/json", - "Accept: application/json", + "Content-Type: */*", + "Accept: ", }) - void updateUser(@Param("username") String username, User body); + void updateUser(User user, @Param("username") String username); + + + } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/auth/OAuth.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/auth/OAuth.java index 2653474747d..125a6ca7d12 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/auth/OAuth.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/auth/OAuth.java @@ -1,9 +1,11 @@ package io.swagger.client.auth; import java.io.IOException; +import java.util.ArrayList; import java.util.Collection; import java.util.Map; import java.util.Map.Entry; +import java.util.stream.Collectors; import org.apache.oltu.oauth2.client.HttpClient; import org.apache.oltu.oauth2.client.OAuthClient; @@ -186,6 +188,10 @@ public T execute(OAuthClientRequest request, Map body, contentType, feignResponse.status(), + feignResponse.headers().entrySet().stream().collect(Collectors.toMap( + Map.Entry::getKey, + e -> new ArrayList<>(e.getValue()) + )), responseClass ); } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 7fe69e168fd..946f6319432 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -28,65 +28,65 @@ */ public class AdditionalPropertiesClass { + @JsonProperty("map_property") private Map mapProperty = null; - + @JsonProperty("map_of_map_property") private Map> mapOfMapProperty = null; - + public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; return this; } 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; } - - /** - * Get mapProperty - * @return mapProperty + /** + * Get mapProperty + * @return mapProperty **/ @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } - public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } - + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; return this; } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { - this.mapOfMapProperty = new HashMap>(); + this.mapOfMapProperty = new HashMap<>(); } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } - - /** - * Get mapOfMapProperty - * @return mapOfMapProperty + /** + * Get mapOfMapProperty + * @return mapOfMapProperty **/ @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -104,8 +104,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapProperty, mapOfMapProperty); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -128,5 +127,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java index 590f36c0ae0..ddd1f98533f 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Animal.java @@ -25,56 +25,60 @@ /** * Animal */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true ) + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Discriminator{propertyName='className', mapping=null}", visible = true ) @JsonSubTypes({ + @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + }) public class Animal { + @JsonProperty("className") private String className = null; - + @JsonProperty("color") private String color = "red"; - + public Animal className(String className) { this.className = className; return this; } - /** - * Get className - * @return className + + /** + * Get className + * @return className **/ @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } - public void setClassName(String className) { this.className = className; } - + public Animal color(String color) { this.color = color; return this; } - /** - * Get color - * @return color + + /** + * Get color + * @return color **/ @ApiModelProperty(value = "") public String getColor() { return color; } - public void setColor(String color) { this.color = color; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -92,8 +96,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(className, color); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -116,5 +119,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AnimalFarm.java deleted file mode 100644 index 0b1d6a74cc6..00000000000 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/AnimalFarm.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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 io.swagger.client.model.Animal; -import java.util.ArrayList; -import java.util.List; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index b7e59a030a4..3e850a94aa5 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -28,36 +28,37 @@ */ public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") private List> arrayArrayNumber = null; - + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; return this; } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } + this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber **/ @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } - public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,8 +75,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayArrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -97,5 +97,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index fdfeb6856f3..8882f76ab46 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -28,36 +28,37 @@ */ public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") private List arrayNumber = null; - + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; return this; } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } + this.arrayNumber.add(arrayNumberItem); return this; } - - /** - * Get arrayNumber - * @return arrayNumber + + /** + * Get arrayNumber + * @return arrayNumber **/ @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } - public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,8 +75,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -97,5 +97,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java index 62665c2536a..8b4867aebff 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ArrayTest.java @@ -28,94 +28,97 @@ */ public class ArrayTest { + @JsonProperty("array_of_string") private List arrayOfString = null; - + @JsonProperty("array_array_of_integer") private List> arrayArrayOfInteger = null; - + @JsonProperty("array_array_of_model") private List> arrayArrayOfModel = null; - + public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; return this; } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } + this.arrayOfString.add(arrayOfStringItem); return this; } - - /** - * Get arrayOfString - * @return arrayOfString + + /** + * Get arrayOfString + * @return arrayOfString **/ @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } - public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } - + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger **/ @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } - + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel **/ @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } - public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -134,8 +137,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -159,5 +161,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Capitalization.java index a72b0a72f46..f534657b4ca 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Capitalization.java @@ -25,133 +25,133 @@ */ public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel = null; - + @JsonProperty("CapitalCamel") private String capitalCamel = null; - + @JsonProperty("small_Snake") private String smallSnake = null; - + @JsonProperty("Capital_Snake") private String capitalSnake = null; - + @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints = null; - + @JsonProperty("ATT_NAME") private String ATT_NAME = null; - + public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; return this; } - /** - * Get smallCamel - * @return smallCamel + + /** + * Get smallCamel + * @return smallCamel **/ @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } - public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } - + public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; return this; } - /** - * Get capitalCamel - * @return capitalCamel + + /** + * Get capitalCamel + * @return capitalCamel **/ @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } - public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } - + public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; return this; } - /** - * Get smallSnake - * @return smallSnake + + /** + * Get smallSnake + * @return smallSnake **/ @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } - public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } - + public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; return this; } - /** - * Get capitalSnake - * @return capitalSnake + + /** + * Get capitalSnake + * @return capitalSnake **/ @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } - public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } - + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; return this; } - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints **/ @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } - public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } - + public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; return this; } - /** - * Name of the pet - * @return ATT_NAME + + /** + * Name of the pet + * @return ATT_NAME **/ @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } - public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -173,8 +173,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -201,5 +200,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java index b882da0ad90..d6e94912f06 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Cat.java @@ -26,28 +26,70 @@ */ public class Cat extends Animal { + + @JsonProperty("className") + private String className = null; + + @JsonProperty("color") + private String color = "red"; + @JsonProperty("declawed") private Boolean declawed = null; + + public Cat className(String className) { + this.className = className; + return this; + } + + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Cat color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; } - /** - * Get declawed - * @return declawed + + /** + * Get declawed + * @return declawed **/ @ApiModelProperty(value = "") public Boolean isDeclawed() { return declawed; } - public void setDeclawed(Boolean declawed) { this.declawed = declawed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -57,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && + return Objects.equals(this.className, cat.className) && + Objects.equals(this.color, cat.color) && + Objects.equals(this.declawed, cat.declawed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(declawed, super.hashCode()); + return Objects.hash(className, color, declawed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); sb.append("}"); return sb.toString(); @@ -88,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java index 464f4375c4b..5ef89bf53cf 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Category.java @@ -25,49 +25,49 @@ */ public class Category { + @JsonProperty("id") private Long id = null; - + @JsonProperty("name") private String name = null; - + public Category id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Category name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -85,8 +85,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -109,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ClassModel.java index 4f764fde68d..887733b7310 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ClassModel.java @@ -22,32 +22,31 @@ /** * Model for testing model with \"_class\" property - */ -@ApiModel(description = "Model for testing model with \"_class\" property") + */@ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { + @JsonProperty("_class") private String propertyClass = null; - + public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,8 +63,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -87,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Client.java index a7c4253499c..6193700c6ca 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Client.java @@ -25,28 +25,28 @@ */ public class Client { + @JsonProperty("client") private String client = null; - + public Client client(String client) { this.client = client; return this; } - /** - * Get client - * @return client + + /** + * Get client + * @return client **/ @ApiModelProperty(value = "") public String getClient() { return client; } - public void setClient(String client) { this.client = client; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,8 +63,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(client); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -86,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java index 7de179b2ade..bffa0917362 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Dog.java @@ -26,28 +26,70 @@ */ public class Dog extends Animal { + + @JsonProperty("className") + private String className = null; + + @JsonProperty("color") + private String color = "red"; + @JsonProperty("breed") private String breed = null; + + public Dog className(String className) { + this.className = className; + return this; + } + + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Dog color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Dog breed(String breed) { this.breed = breed; return this; } - /** - * Get breed - * @return breed + + /** + * Get breed + * @return breed **/ @ApiModelProperty(value = "") public String getBreed() { return breed; } - public void setBreed(String breed) { this.breed = breed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -57,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && + return Objects.equals(this.className, dog.className) && + Objects.equals(this.color, dog.color) && + Objects.equals(this.breed, dog.breed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(breed, super.hashCode()); + return Objects.hash(className, color, breed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); sb.append("}"); return sb.toString(); @@ -88,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java index 12caa480285..c46a90c300a 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java @@ -27,12 +27,13 @@ */ public class EnumArrays { - /** + + /** * Gets or Sets justSymbol */ public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), + GREATER_THAN_OR_EQUAL_TO(">="), DOLLAR("$"); private String value; @@ -40,8 +41,9 @@ public enum JustSymbolEnum { JustSymbolEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -50,8 +52,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static JustSymbolEnum fromValue(String text) { for (JustSymbolEnum b : JustSymbolEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -60,17 +63,20 @@ public static JustSymbolEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("just_symbol") private JustSymbolEnum justSymbol = null; - - /** + + + /** * Gets or Sets arrayEnum */ public enum ArrayEnumEnum { - FISH("fish"), + FISH("fish"), CRAB("crab"); private String value; @@ -78,8 +84,9 @@ public enum ArrayEnumEnum { ArrayEnumEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -88,8 +95,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static ArrayEnumEnum fromValue(String text) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -98,56 +106,57 @@ public static ArrayEnumEnum fromValue(String text) { } return null; } + } - + @JsonProperty("array_enum") private List arrayEnum = null; - + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; return this; } - /** - * Get justSymbol - * @return justSymbol + + /** + * Get justSymbol + * @return justSymbol **/ @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } - public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } - + public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; return this; } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } + this.arrayEnum.add(arrayEnumItem); return this; } - - /** - * Get arrayEnum - * @return arrayEnum + + /** + * Get arrayEnum + * @return arrayEnum **/ @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } - public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -165,8 +174,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -189,5 +197,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumClass.java index abbd7a56668..9414211ef6c 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumClass.java @@ -13,14 +13,17 @@ package io.swagger.client.model; -import java.util.Objects; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + + /** * Gets or Sets EnumClass */ + public enum EnumClass { _ABC("_abc"), @@ -35,7 +38,9 @@ public enum EnumClass { this.value = value; } + @JsonValue + public String getValue() { return value; } @@ -45,7 +50,9 @@ public String toString() { return String.valueOf(value); } + @JsonCreator + public static EnumClass fromValue(String text) { for (EnumClass b : EnumClass.values()) { if (String.valueOf(b.value).equals(text)) { @@ -54,5 +61,8 @@ public static EnumClass fromValue(String text) { } return null; } + } + + 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 93d0da037b6..4634e7018db 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 @@ -26,14 +26,14 @@ */ public class EnumTest { - /** + + /** * Gets or Sets enumString */ public enum EnumStringEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"), - EMPTY(""); private String value; @@ -41,8 +41,9 @@ public enum EnumStringEnum { EnumStringEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -51,8 +52,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumStringEnum fromValue(String text) { for (EnumStringEnum b : EnumStringEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -61,17 +63,19 @@ public static EnumStringEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_string") private EnumStringEnum enumString = null; - - /** + + /** * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(1), NUMBER_MINUS_1(-1); private Integer value; @@ -79,8 +83,9 @@ public enum EnumIntegerEnum { EnumIntegerEnum(Integer value) { this.value = value; } - + @JsonValue + public Integer getValue() { return value; } @@ -89,8 +94,9 @@ public Integer getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumIntegerEnum fromValue(String text) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -99,17 +105,19 @@ public static EnumIntegerEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger = null; - - /** + + /** * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(1.1), NUMBER_MINUS_1_DOT_2(-1.2); private Double value; @@ -117,8 +125,9 @@ public enum EnumNumberEnum { EnumNumberEnum(Double value) { this.value = value; } - + @JsonValue + public Double getValue() { return value; } @@ -127,8 +136,9 @@ public Double getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumNumberEnum fromValue(String text) { for (EnumNumberEnum b : EnumNumberEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -137,87 +147,88 @@ public static EnumNumberEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_number") private EnumNumberEnum enumNumber = null; - + @JsonProperty("outerEnum") private OuterEnum outerEnum = null; - + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; } - /** - * Get enumString - * @return enumString + + /** + * Get enumString + * @return enumString **/ @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } - public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } - + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; } - /** - * Get enumInteger - * @return enumInteger + + /** + * Get enumInteger + * @return enumInteger **/ @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } - public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } - + public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; return this; } - /** - * Get enumNumber - * @return enumNumber + + /** + * Get enumNumber + * @return enumNumber **/ @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } - public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - + public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; return this; } - /** - * Get outerEnum - * @return outerEnum + + /** + * Get outerEnum + * @return outerEnum **/ @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -237,8 +248,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -263,5 +273,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\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 4118656d29e..df02f3998d4 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 @@ -29,290 +29,284 @@ */ public class FormatTest { + @JsonProperty("integer") private Integer integer = null; - + @JsonProperty("int32") private Integer int32 = null; - + @JsonProperty("int64") private Long int64 = null; - + @JsonProperty("number") private BigDecimal number = null; - + @JsonProperty("float") private Float _float = null; - + @JsonProperty("double") private Double _double = null; - + @JsonProperty("string") private String string = null; - + @JsonProperty("byte") - private byte[] _byte = null; - + private String _byte = null; + @JsonProperty("binary") - private byte[] binary = null; - + private String binary = null; + @JsonProperty("date") private LocalDate date = null; - + @JsonProperty("dateTime") private OffsetDateTime dateTime = null; - + @JsonProperty("uuid") private UUID uuid = null; - + @JsonProperty("password") private String password = null; - + public FormatTest integer(Integer integer) { this.integer = integer; return this; } - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer **/ @ApiModelProperty(value = "") public Integer getInteger() { return integer; } - public void setInteger(Integer integer) { this.integer = integer; } - + public FormatTest int32(Integer int32) { this.int32 = int32; return this; } - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 **/ @ApiModelProperty(value = "") public Integer getInt32() { return int32; } - public void setInt32(Integer int32) { this.int32 = int32; } - + public FormatTest int64(Long int64) { this.int64 = int64; return this; } - /** - * Get int64 - * @return int64 + + /** + * Get int64 + * @return int64 **/ @ApiModelProperty(value = "") public Long getInt64() { return int64; } - public void setInt64(Long int64) { this.int64 = int64; } - + public FormatTest number(BigDecimal number) { this.number = number; return this; } - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number + + /** + * Get number + * @return number **/ @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } - public void setNumber(BigDecimal number) { this.number = number; } - + public FormatTest _float(Float _float) { this._float = _float; return this; } - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float + + /** + * Get _float + * @return _float **/ @ApiModelProperty(value = "") public Float getFloat() { return _float; } - public void setFloat(Float _float) { this._float = _float; } - + public FormatTest _double(Double _double) { this._double = _double; return this; } - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double + + /** + * Get _double + * @return _double **/ @ApiModelProperty(value = "") public Double getDouble() { return _double; } - public void setDouble(Double _double) { this._double = _double; } - + public FormatTest string(String string) { this.string = string; return this; } - /** - * Get string - * @return string + + /** + * Get string + * @return string **/ @ApiModelProperty(value = "") public String getString() { return string; } - public void setString(String string) { this.string = string; } - - public FormatTest _byte(byte[] _byte) { + + public FormatTest _byte(String _byte) { this._byte = _byte; return this; } - /** - * Get _byte - * @return _byte + + /** + * Get _byte + * @return _byte **/ @ApiModelProperty(required = true, value = "") - public byte[] getByte() { + public String getByte() { return _byte; } - - public void setByte(byte[] _byte) { + public void setByte(String _byte) { this._byte = _byte; } - - public FormatTest binary(byte[] binary) { + + public FormatTest binary(String binary) { this.binary = binary; return this; } - /** - * Get binary - * @return binary + + /** + * Get binary + * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public String getBinary() { return binary; } - - public void setBinary(byte[] binary) { + public void setBinary(String binary) { this.binary = binary; } - + public FormatTest date(LocalDate date) { this.date = date; return this; } - /** - * Get date - * @return date + + /** + * Get date + * @return date **/ @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } - public void setDate(LocalDate date) { this.date = date; } - + public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public FormatTest password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -341,8 +335,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -376,5 +369,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 6dc9f12c4b8..98a721fb9dc 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -25,31 +25,33 @@ */ public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar = null; - + @JsonProperty("foo") private String foo = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - - /** - * Get foo - * @return foo + + + /** + * Get foo + * @return foo **/ @ApiModelProperty(value = "") public String getFoo() { return foo; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,8 +69,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, foo); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -91,5 +92,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java index e6344a1df0f..cc0556cfb88 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java @@ -28,15 +28,17 @@ */ public class MapTest { + @JsonProperty("map_map_of_string") private Map> mapMapOfString = null; - - /** + + + /** * Gets or Sets inner */ public enum InnerEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"); private String value; @@ -44,8 +46,9 @@ public enum InnerEnum { InnerEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -54,8 +57,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static InnerEnum fromValue(String text) { for (InnerEnum b : InnerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -64,64 +68,64 @@ public static InnerEnum fromValue(String text) { } return null; } + } - + @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; - + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; } 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; } - - /** - * Get mapMapOfString - * @return mapMapOfString + /** + * Get mapMapOfString + * @return mapMapOfString **/ @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } - public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } - + public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; return this; } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } + this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } - - /** - * Get mapOfEnumString - * @return mapOfEnumString + /** + * Get mapOfEnumString + * @return mapOfEnumString **/ @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } - public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -139,8 +143,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -163,5 +166,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 29bfc7e8c08..85e25e354ee 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -31,78 +31,78 @@ */ public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid = null; - + @JsonProperty("dateTime") private OffsetDateTime dateTime = null; - + @JsonProperty("map") private Map map = null; - + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; return this; } 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; } - - /** - * Get map - * @return map + /** + * Get map + * @return map **/ @ApiModelProperty(value = "") public Map getMap() { return map; } - public void setMap(Map map) { this.map = map; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -121,8 +121,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(uuid, dateTime, map); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -146,5 +145,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 58624475e43..606b051c2ea 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 @@ -22,53 +22,52 @@ /** * Model for testing model name starting with number - */ -@ApiModel(description = "Model for testing model name starting with number") + */@ApiModel(description = "Model for testing model name starting with number") public class Model200Response { + @JsonProperty("name") private Integer name = null; - + @JsonProperty("class") private String propertyClass = null; - + public Model200Response name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - + public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -86,8 +85,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -110,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java index b010e53b48c..4002f3f632e 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -25,70 +25,70 @@ */ public class ModelApiResponse { + @JsonProperty("code") private Integer code = null; - + @JsonProperty("type") private String type = null; - + @JsonProperty("message") private String message = null; - + public ModelApiResponse code(Integer code) { this.code = code; return this; } - /** - * Get code - * @return code + + /** + * Get code + * @return code **/ @ApiModelProperty(value = "") public Integer getCode() { return code; } - public void setCode(Integer code) { this.code = code; } - + public ModelApiResponse type(String type) { this.type = type; return this; } - /** - * Get type - * @return type + + /** + * Get type + * @return type **/ @ApiModelProperty(value = "") public String getType() { return type; } - public void setType(String type) { this.type = type; } - + public ModelApiResponse message(String message) { this.message = message; return this; } - /** - * Get message - * @return message + + /** + * Get message + * @return message **/ @ApiModelProperty(value = "") public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -107,8 +107,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(code, type, message); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -132,5 +131,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java index 27d08557248..685e5ba93ac 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelReturn.java @@ -22,32 +22,31 @@ /** * Model for testing reserved words - */ -@ApiModel(description = "Model for testing reserved words") + */@ApiModel(description = "Model for testing reserved words") public class ModelReturn { + @JsonProperty("return") private Integer _return = null; - + public ModelReturn _return(Integer _return) { this._return = _return; return this; } - /** - * Get _return - * @return _return + + /** + * Get _return + * @return _return **/ @ApiModelProperty(value = "") public Integer getReturn() { return _return; } - public void setReturn(Integer _return) { this._return = _return; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,8 +63,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(_return); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -87,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 f2b9b1703bd..7c94ab233c2 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 @@ -22,77 +22,78 @@ /** * Model for testing model name same as property name - */ -@ApiModel(description = "Model for testing model name same as property name") + */@ApiModel(description = "Model for testing model name same as property name") public class Name { + @JsonProperty("name") private Integer name = null; - + @JsonProperty("snake_case") private Integer snakeCase = null; - + @JsonProperty("property") private String property = null; - + @JsonProperty("123Number") private Integer _123Number = null; - + public Name name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - - /** - * Get snakeCase - * @return snakeCase + + + /** + * Get snakeCase + * @return snakeCase **/ @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } - + public Name property(String property) { this.property = property; return this; } - /** - * Get property - * @return property + + /** + * Get property + * @return property **/ @ApiModelProperty(value = "") public String getProperty() { return property; } - public void setProperty(String property) { this.property = property; } - - /** - * Get _123Number - * @return _123Number + + + /** + * Get _123Number + * @return _123Number **/ @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,8 +113,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, snakeCase, property, _123Number); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -138,5 +138,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java index ec93aba0531..dc53f9e50dc 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/NumberOnly.java @@ -26,28 +26,28 @@ */ public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber = null; - + public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; return this; } - /** - * Get justNumber - * @return justNumber + + /** + * Get justNumber + * @return justNumber **/ @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } - public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,8 +64,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -87,5 +86,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java index 6976ceb8fba..0a6d7ad0933 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java @@ -26,26 +26,26 @@ */ public class Order { + @JsonProperty("id") private Long id = null; - + @JsonProperty("petId") private Long petId = null; - + @JsonProperty("quantity") private Integer quantity = null; - + @JsonProperty("shipDate") private OffsetDateTime shipDate = null; - - /** + + /** * Order Status */ public enum StatusEnum { - PLACED("placed"), + PLACED("placed"), APPROVED("approved"), - DELIVERED("delivered"); private String value; @@ -53,8 +53,9 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -63,8 +64,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -73,123 +75,124 @@ public static StatusEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("status") private StatusEnum status = null; - + @JsonProperty("complete") private Boolean complete = false; - + public Order id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Order petId(Long petId) { this.petId = petId; return this; } - /** - * Get petId - * @return petId + + /** + * Get petId + * @return petId **/ @ApiModelProperty(value = "") public Long getPetId() { return petId; } - public void setPetId(Long petId) { this.petId = petId; } - + public Order quantity(Integer quantity) { this.quantity = quantity; return this; } - /** - * Get quantity - * @return quantity + + /** + * Get quantity + * @return quantity **/ @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } - public void setQuantity(Integer quantity) { this.quantity = quantity; } - + public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; return this; } - /** - * Get shipDate - * @return shipDate + + /** + * Get shipDate + * @return shipDate **/ @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } - public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } - + public Order status(StatusEnum status) { this.status = status; return this; } - /** - * Order Status - * @return status + + /** + * Order Status + * @return status **/ @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - + public Order complete(Boolean complete) { this.complete = complete; return this; } - /** - * Get complete - * @return complete + + /** + * Get complete + * @return complete **/ @ApiModelProperty(value = "") public Boolean isComplete() { return complete; } - public void setComplete(Boolean complete) { this.complete = complete; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -211,8 +214,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -239,5 +241,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterComposite.java index 02c16a99b70..8b957f45a14 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterComposite.java @@ -26,70 +26,70 @@ */ public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber = null; - + @JsonProperty("my_string") private String myString = null; - + @JsonProperty("my_boolean") private Boolean myBoolean = null; - + public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; return this; } - /** - * Get myNumber - * @return myNumber + + /** + * Get myNumber + * @return myNumber **/ @ApiModelProperty(value = "") public BigDecimal getMyNumber() { return myNumber; } - public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } - + public OuterComposite myString(String myString) { this.myString = myString; return this; } - /** - * Get myString - * @return myString + + /** + * Get myString + * @return myString **/ @ApiModelProperty(value = "") public String getMyString() { return myString; } - public void setMyString(String myString) { this.myString = myString; } - + public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; return this; } - /** - * Get myBoolean - * @return myBoolean + + /** + * Get myBoolean + * @return myBoolean **/ @ApiModelProperty(value = "") public Boolean getMyBoolean() { return myBoolean; } - public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -108,8 +108,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(myNumber, myString, myBoolean); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -133,5 +132,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterEnum.java index 948d80c2e6d..3390d473c7b 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterEnum.java @@ -13,14 +13,17 @@ package io.swagger.client.model; -import java.util.Objects; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + + /** * Gets or Sets OuterEnum */ + public enum OuterEnum { PLACED("placed"), @@ -35,7 +38,9 @@ public enum OuterEnum { this.value = value; } + @JsonValue + public String getValue() { return value; } @@ -45,7 +50,9 @@ public String toString() { return String.valueOf(value); } + @JsonCreator + public static OuterEnum fromValue(String text) { for (OuterEnum b : OuterEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -54,5 +61,8 @@ public static OuterEnum fromValue(String text) { } return null; } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java index 4c351dec3e4..2bda9b34787 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java @@ -29,29 +29,29 @@ */ public class Pet { + @JsonProperty("id") private Long id = null; - + @JsonProperty("category") private Category category = null; - + @JsonProperty("name") private String name = null; - + @JsonProperty("photoUrls") - private List photoUrls = new ArrayList(); - + private List photoUrls = new ArrayList<>(); + @JsonProperty("tags") private List tags = null; - - /** + + /** * pet status in the store */ public enum StatusEnum { - AVAILABLE("available"), + AVAILABLE("available"), PENDING("pending"), - SOLD("sold"); private String value; @@ -59,8 +59,9 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -69,8 +70,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -79,133 +81,135 @@ public static StatusEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("status") private StatusEnum status = null; - + public Pet id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Pet category(Category category) { this.category = category; return this; } - /** - * Get category - * @return category + + /** + * Get category + * @return category **/ @ApiModelProperty(value = "") public Category getCategory() { return category; } - public void setCategory(Category category) { this.category = category; } - + public Pet name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - + public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); return this; } - - /** - * Get photoUrls - * @return photoUrls + + /** + * Get photoUrls + * @return photoUrls **/ @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } - + public Pet tags(List tags) { this.tags = tags; return this; } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } + this.tags.add(tagsItem); return this; } - - /** - * Get tags - * @return tags + + /** + * Get tags + * @return tags **/ @ApiModelProperty(value = "") public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } - + public Pet status(StatusEnum status) { this.status = status; return this; } - /** - * pet status in the store - * @return status + + /** + * pet status in the store + * @return status **/ @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -227,8 +231,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -255,5 +258,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 76f8a912f36..1532a30b9e9 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -25,40 +25,41 @@ */ public class ReadOnlyFirst { + @JsonProperty("bar") private String bar = null; - + @JsonProperty("baz") private String baz = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; } - /** - * Get baz - * @return baz + + /** + * Get baz + * @return baz **/ @ApiModelProperty(value = "") public String getBaz() { return baz; } - public void setBaz(String baz) { this.baz = baz; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -76,8 +77,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, baz); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,5 +100,8 @@ private String toIndentedString(java.lang.Object o) { 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 784eb8baca8..38b54fd6c38 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 @@ -25,28 +25,28 @@ */ public class SpecialModelName { - @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + @JsonProperty("$special[property.name]") + private Long $specialPropertyName = null; + + 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; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -55,22 +55,21 @@ public boolean equals(java.lang.Object o) { 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); } - - + @Override public String toString() { 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(); } @@ -86,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java index 1cf2f5bc5e6..2967322b174 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Tag.java @@ -25,49 +25,49 @@ */ public class Tag { + @JsonProperty("id") private Long id = null; - + @JsonProperty("name") private String name = null; - + public Tag id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Tag name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -85,8 +85,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -109,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java index de5bc439c5a..cb2f9f34084 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/User.java @@ -25,175 +25,175 @@ */ public class User { + @JsonProperty("id") private Long id = null; - + @JsonProperty("username") private String username = null; - + @JsonProperty("firstName") private String firstName = null; - + @JsonProperty("lastName") private String lastName = null; - + @JsonProperty("email") private String email = null; - + @JsonProperty("password") private String password = null; - + @JsonProperty("phone") private String phone = null; - + @JsonProperty("userStatus") private Integer userStatus = null; - + public User id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public User username(String username) { this.username = username; return this; } - /** - * Get username - * @return username + + /** + * Get username + * @return username **/ @ApiModelProperty(value = "") public String getUsername() { return username; } - public void setUsername(String username) { this.username = username; } - + public User firstName(String firstName) { this.firstName = firstName; return this; } - /** - * Get firstName - * @return firstName + + /** + * Get firstName + * @return firstName **/ @ApiModelProperty(value = "") public String getFirstName() { return firstName; } - public void setFirstName(String firstName) { this.firstName = firstName; } - + public User lastName(String lastName) { this.lastName = lastName; return this; } - /** - * Get lastName - * @return lastName + + /** + * Get lastName + * @return lastName **/ @ApiModelProperty(value = "") public String getLastName() { return lastName; } - public void setLastName(String lastName) { this.lastName = lastName; } - + public User email(String email) { this.email = email; return this; } - /** - * Get email - * @return email + + /** + * Get email + * @return email **/ @ApiModelProperty(value = "") public String getEmail() { return email; } - public void setEmail(String email) { this.email = email; } - + public User password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - + public User phone(String phone) { this.phone = phone; return this; } - /** - * Get phone - * @return phone + + /** + * Get phone + * @return phone **/ @ApiModelProperty(value = "") public String getPhone() { return phone; } - public void setPhone(String phone) { this.phone = phone; } - + public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; } - /** - * User Status - * @return userStatus + + /** + * User Status + * @return userStatus **/ @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } - public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -217,8 +217,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -247,5 +246,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..037a03f4917 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 @@ -2,14 +2,17 @@ import io.swagger.client.ApiClient; import io.swagger.client.model.Client; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for AnotherFakeApi */ @@ -30,11 +33,14 @@ public void setup() { */ @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..d1b77955b06 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,17 +3,18 @@ import io.swagger.client.ApiClient; 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 org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for FakeApi */ @@ -34,12 +35,15 @@ public void setup() { */ @Test public void fakeOuterBooleanSerializeTest() { + Boolean body = null; + // Boolean response = api.fakeOuterBooleanSerialize(body); // TODO: test validations } + /** * @@ -48,12 +52,15 @@ public void fakeOuterBooleanSerializeTest() { */ @Test public void fakeOuterCompositeSerializeTest() { - OuterComposite body = null; - // OuterComposite response = api.fakeOuterCompositeSerialize(body); + + OuterComposite outercomposite = null; + + // OuterComposite response = api.fakeOuterCompositeSerialize(outercomposite); // TODO: test validations } + /** * @@ -62,12 +69,15 @@ public void fakeOuterCompositeSerializeTest() { */ @Test public void fakeOuterNumberSerializeTest() { + BigDecimal body = null; + // BigDecimal response = api.fakeOuterNumberSerialize(body); // TODO: test validations } + /** * @@ -76,12 +86,15 @@ public void fakeOuterNumberSerializeTest() { */ @Test public void fakeOuterStringSerializeTest() { + String body = null; + // String response = api.fakeOuterStringSerialize(body); // TODO: test validations } + /** * To test \"client\" model @@ -90,12 +103,15 @@ public void fakeOuterStringSerializeTest() { */ @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 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -104,25 +120,15 @@ public void testClientModelTest() { */ @Test public void testEndpointParametersTest() { - BigDecimal number = null; - Double _double = null; - String patternWithoutDelimiter = null; - byte[] _byte = null; - Integer integer = null; - Integer int32 = null; - Long int64 = null; - Float _float = null; - String string = null; - byte[] binary = null; - LocalDate date = null; - OffsetDateTime dateTime = null; - String password = null; - String paramCallback = null; - // api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + + Object body = null; + + // api.testEndpointParameters(body); // TODO: test validations } + /** * To test enum parameters @@ -131,19 +137,25 @@ public void testEndpointParametersTest() { */ @Test public void testEnumParametersTest() { - List enumFormStringArray = null; - String enumFormString = null; + + Object body = 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); + + // api.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); // TODO: test validations } + /** * To test enum parameters * @@ -154,18 +166,71 @@ public void testEnumParametersTest() { */ @Test public void testEnumParametersTestQueryMap() { - List enumFormStringArray = null; - String enumFormString = null; + + + Object body = null; + + + List enumHeaderStringArray = null; + + + String enumHeaderString = null; - Double enumQueryDouble = null; + + + + + + + + FakeApi.TestEnumParametersQueryParams queryParams = new FakeApi.TestEnumParametersQueryParams() + .enumQueryStringArray(null) + .enumQueryString(null) + .enumQueryInteger(null); - // api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryDouble, queryParams); + + // api.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, queryParams); // TODO: test validations } + + + /** + * test inline additionalProperties + * + * + */ + @Test + public void testInlineAdditionalPropertiesTest() { + + Map body = null; + + // api.testInlineAdditionalProperties(body); + + // TODO: test validations + } + + + + /** + * test json serialization of form data + * + * + */ + @Test + public void testJsonFormDataTest() { + + Object body = null; + + // api.testJsonFormData(body); + + // 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..0fb476a4575 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 @@ -2,14 +2,17 @@ import io.swagger.client.ApiClient; import io.swagger.client.model.Client; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for FakeClassnameTags123Api */ @@ -30,10 +33,14 @@ public void setup() { */ @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..895f720be8d 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,216 @@ package io.swagger.client.api; -import io.swagger.TestUtils; - import io.swagger.client.ApiClient; -import io.swagger.client.model.*; +import io.swagger.client.model.ModelApiResponse; +import io.swagger.client.model.Pet; + +import org.junit.Before; +import org.junit.Test; + -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; 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); - - Pet fetched = api.getPetById(pet.getId()); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); + public void deletePetTest() { + + Integer 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 testUpdatePet() throws Exception { - Pet pet = createRandomPet(); - pet.setName("programmer"); - - api.updatePet(pet); + public void findPetsByStatusTest() { + + List status = null; + + // List response = api.findPetsByStatus(status); - 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); - - found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } - - assertTrue(found); - } + + .status(null); + + // List response = api.findPetsByStatus(queryParams); + // 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); - - 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 findPetsByTagsTest() { + + List tags = null; + + // List response = api.findPetsByTags(tags); - PetApi.FindPetsByTagsQueryParams queryParams = new PetApi.FindPetsByTagsQueryParams() - .tags(Arrays.asList(new String[]{"friendly"})); - pets = api.findPetsByTags(queryParams); - assertNotNull(pets); - - 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. + * + * This tests the overload of the method that uses a Map for query parameters instead of + * listing them out individually. + */ @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()); + public void findPetsByTagsTestQueryMap() { + + + + PetApi.FindPetsByTagsQueryParams queryParams = new PetApi.FindPetsByTagsQueryParams() + + .tags(null); + + // List response = api.findPetsByTags(queryParams); - assertEquals(updated.getName(), "furt"); + // TODO: test validations } - + + + /** + * Find pet by ID + * + * Returns a single pet + */ @Test - public void testDeletePet() throws Exception { - Pet pet = createRandomPet(); - api.addPet(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()); - } + public void getPetByIdTest() { + + Integer petId = null; + + // Pet response = api.getPetById(petId); + + // TODO: test validations } + + + /** + * Update an existing pet + * + * + */ @Test - public void testUploadFile() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet); + public void updatePetTest() { + + Pet pet = null; + + // api.updatePet(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())); + // TODO: test validations } + + + /** + * Updates a pet in the store with form data + * + * + */ @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()); + public void updatePetWithFormTest() { + + Integer petId = null; + + Object body = null; + + // api.updatePetWithForm(petId, body); + + // TODO: test validations } + + + /** + * uploads an image + * + * + */ @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(); + public void uploadFileTest() { + + Integer petId = null; + + Object body = null; + + // ModelApiResponse response = api.uploadFile(petId, body); + + // TODO: test validations } - 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..7d20b408550 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,95 @@ package io.swagger.client.api; -import feign.FeignException; +import io.swagger.client.ApiClient; +import io.swagger.client.model.Order; -import io.swagger.TestUtils; +import org.junit.Before; +import org.junit.Test; -import io.swagger.client.ApiClient; -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 + */ 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); - - 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())); + 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 { - Order order = createOrder(); - api.placeOrder(order); + public void getOrderByIdTest() { + + Integer orderId = null; + + // Order response = api.getOrderById(orderId); - Order fetched = api.getOrderById(order.getId()); - assertEquals(fetched.getId(), order.getId()); + // TODO: test validations + } - api.deleteOrder(order.getId().toString()); + + + /** + * Place an order for a pet + * + * + */ + @Test + public void placeOrderTest() { + + Order order = null; + + // Order response = api.placeOrder(order); - 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); - - try { - Field idField = Order.class.getDeclaredField("id"); - idField.setAccessible(true); - idField.set(order, TestUtils.nextId()); - } catch (Exception e) { - throw new RuntimeException(e); - } - - return order; - } + + } 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..24bf0a5fe01 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,193 @@ 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 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 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(); - - api.createUser(user); + 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 + * + * + */ @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 body = null; + + // api.createUsersWithArrayInput(body); - 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 body = null; + + // api.createUsersWithListInput(body); - api.createUsersWithListInput(Arrays.asList(user1, user2)); + // TODO: test validations + } - User fetched = api.getUserByName(user1.getUsername()); - assertEquals(user1.getId(), fetched.getId()); + + + /** + * Delete user + * + * This can only be done by the logged in user. + */ + @Test + public void deleteUserTest() { + + String username = null; + + // api.deleteUser(username); + + // 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); + + + /** + * Get user by user name + * + * + */ + @Test + public void getUserByNameTest() { + + String username = null; + + // User response = api.getUserByName(username); - String token = api.loginUser(user.getUsername(), user.getPassword()); - assertTrue(token.startsWith("logged in user session:")); + // TODO: test validations + } - UserApi.LoginUserQueryParams queryParams = new UserApi.LoginUserQueryParams() - .username(user.getUsername()) - .password(user.getPassword()); - token = api.loginUser(queryParams); - assertTrue(token.startsWith("logged in user session:")); + + + /** + * 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 logoutUser() throws Exception { - api.logoutUser(); + public void loginUserTestQueryMap() { + + + + + + UserApi.LoginUserQueryParams queryParams = new UserApi.LoginUserQueryParams() + + .username(null) + + .password(null); + + // String response = api.loginUser(queryParams); + + // TODO: test validations } + + + /** + * Logs out current logged in user session + * + * + */ + @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. + */ + @Test + public void updateUserTest() { + + User user = null; + + String username = null; + + // api.updateUser(user, username); + + // TODO: test validations + } + + + } diff --git a/samples/client/petstore/java/jersey1/.swagger-codegen/VERSION b/samples/client/petstore/java/jersey1/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/client/petstore/java/jersey1/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/jersey1/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey1/README.md b/samples/client/petstore/java/jersey1/README.md index 264fe34c81a..5f1911dd209 100644 --- a/samples/client/petstore/java/jersey1/README.md +++ b/samples/client/petstore/java/jersey1/README.md @@ -61,32 +61,27 @@ 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) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + + + AnotherFakeApi apiInstance = new AnotherFakeApi(); + + Client client = ; // Client | client model - 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); + 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 +91,21 @@ 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* | [**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 +114,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 @@ -128,13 +132,16 @@ Class | Method | HTTP request | Description - [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) @@ -147,6 +154,8 @@ Class | Method | HTTP request | Description - [Name](docs/Name.md) - [NumberOnly](docs/NumberOnly.md) - [Order](docs/Order.md) + - [OuterComposite](docs/OuterComposite.md) + - [OuterEnum](docs/OuterEnum.md) - [Pet](docs/Pet.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - [SpecialModelName](docs/SpecialModelName.md) @@ -163,19 +172,42 @@ 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 - **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 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 1845b51a5dc..59e640f259f 100644 --- a/samples/client/petstore/java/jersey1/build.gradle +++ b/samples/client/petstore/java/jersey1/build.gradle @@ -32,8 +32,11 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { + + sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 + } // Rename the aar correctly @@ -78,8 +81,11 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven' + + sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 + install { repositories.mavenInstaller { @@ -109,7 +115,13 @@ 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.brsanthu:migbase64:2.2" + testCompile "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/jersey1/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/jersey1/docs/AdditionalPropertiesClass.md index 0437c4dd8cc..b37862da7cf 100644 --- a/samples/client/petstore/java/jersey1/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/java/jersey1/docs/AdditionalPropertiesClass.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey1/docs/Animal.md b/samples/client/petstore/java/jersey1/docs/Animal.md index b3f325c3524..346caaf63f4 100644 --- a/samples/client/petstore/java/jersey1/docs/Animal.md +++ b/samples/client/petstore/java/jersey1/docs/Animal.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey1/docs/AnimalFarm.md b/samples/client/petstore/java/jersey1/docs/AnimalFarm.md deleted file mode 100644 index c7c7f1ddcce..00000000000 --- a/samples/client/petstore/java/jersey1/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ - -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - diff --git a/samples/client/petstore/java/jersey1/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey1/docs/AnotherFakeApi.md index 7a04619aaba..fb5c988e6cc 100644 --- a/samples/client/petstore/java/jersey1/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/jersey1/docs/AnotherFakeApi.md @@ -7,9 +7,11 @@ Method | HTTP request | Description [**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -22,10 +24,13 @@ To test special tags //import io.swagger.client.api.AnotherFakeApi; + AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +42,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -52,3 +58,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + + diff --git a/samples/client/petstore/java/jersey1/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/jersey1/docs/ArrayOfArrayOfNumberOnly.md index 77292549927..3671a5e9190 100644 --- a/samples/client/petstore/java/jersey1/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/java/jersey1/docs/ArrayOfArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey1/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/jersey1/docs/ArrayOfNumberOnly.md index e8cc4cd36dc..30b9b6648f4 100644 --- a/samples/client/petstore/java/jersey1/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/java/jersey1/docs/ArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey1/docs/ArrayTest.md b/samples/client/petstore/java/jersey1/docs/ArrayTest.md index 9feee16427f..4ab76343030 100644 --- a/samples/client/petstore/java/jersey1/docs/ArrayTest.md +++ b/samples/client/petstore/java/jersey1/docs/ArrayTest.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey1/docs/Capitalization.md b/samples/client/petstore/java/jersey1/docs/Capitalization.md index 0f3064c1996..9af7864f97e 100644 --- a/samples/client/petstore/java/jersey1/docs/Capitalization.md +++ b/samples/client/petstore/java/jersey1/docs/Capitalization.md @@ -13,3 +13,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey1/docs/Cat.md b/samples/client/petstore/java/jersey1/docs/Cat.md index 6e9f71ce7dd..5e408344021 100644 --- a/samples/client/petstore/java/jersey1/docs/Cat.md +++ b/samples/client/petstore/java/jersey1/docs/Cat.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **declawed** | **Boolean** | | [optional] + diff --git a/samples/client/petstore/java/jersey1/docs/Category.md b/samples/client/petstore/java/jersey1/docs/Category.md index e2df0803278..deb5a3e2a52 100644 --- a/samples/client/petstore/java/jersey1/docs/Category.md +++ b/samples/client/petstore/java/jersey1/docs/Category.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey1/docs/ClassModel.md b/samples/client/petstore/java/jersey1/docs/ClassModel.md index 64f880c8786..49c281cc0ed 100644 --- a/samples/client/petstore/java/jersey1/docs/ClassModel.md +++ b/samples/client/petstore/java/jersey1/docs/ClassModel.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey1/docs/Client.md b/samples/client/petstore/java/jersey1/docs/Client.md index 5c490ea166c..52b2f72c79c 100644 --- a/samples/client/petstore/java/jersey1/docs/Client.md +++ b/samples/client/petstore/java/jersey1/docs/Client.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey1/docs/Dog.md b/samples/client/petstore/java/jersey1/docs/Dog.md index ac7cea323ff..00e6446e9f5 100644 --- a/samples/client/petstore/java/jersey1/docs/Dog.md +++ b/samples/client/petstore/java/jersey1/docs/Dog.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **breed** | **String** | | [optional] + diff --git a/samples/client/petstore/java/jersey1/docs/EnumArrays.md b/samples/client/petstore/java/jersey1/docs/EnumArrays.md index 4dddc0bfd27..939a0e69587 100644 --- a/samples/client/petstore/java/jersey1/docs/EnumArrays.md +++ b/samples/client/petstore/java/jersey1/docs/EnumArrays.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] + ## Enum: JustSymbolEnum Name | Value @@ -20,8 +21,6 @@ DOLLAR | "$" ## Enum: List<ArrayEnumEnum> Name | Value ---- | ----- -FISH | "fish" -CRAB | "crab" diff --git a/samples/client/petstore/java/jersey1/docs/EnumTest.md b/samples/client/petstore/java/jersey1/docs/EnumTest.md index 08fee344882..9722c621962 100644 --- a/samples/client/petstore/java/jersey1/docs/EnumTest.md +++ b/samples/client/petstore/java/jersey1/docs/EnumTest.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] + ## Enum: EnumStringEnum Name | Value diff --git a/samples/client/petstore/java/jersey1/docs/FakeApi.md b/samples/client/petstore/java/jersey1/docs/FakeApi.md index 737ccc28293..6690b870e4e 100644 --- a/samples/client/petstore/java/jersey1/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey1/docs/FakeApi.md @@ -15,6 +15,8 @@ Method | HTTP request | Description [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data + + # **fakeOuterBooleanSerialize** > Boolean fakeOuterBooleanSerialize(body) @@ -30,8 +32,11 @@ Test serialization of outer boolean types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body + +Boolean body = ; // Boolean | Input boolean as post body + try { Boolean result = apiInstance.fakeOuterBooleanSerialize(body); System.out.println(result); @@ -47,6 +52,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + ### Return type **Boolean** @@ -57,12 +63,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outercomposite) @@ -75,10 +82,13 @@ Test serialization of object with outer number type //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body + +OuterComposite 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 +100,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outercomposite** | [**OuterComposite**](.md)| Input composite as post body | [optional] + ### Return type @@ -102,8 +113,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterNumberSerialize** @@ -120,8 +132,11 @@ Test serialization of outer number types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body + +BigDecimal body = ; // BigDecimal | Input number as post body + try { BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); System.out.println(result); @@ -137,6 +152,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + ### Return type [**BigDecimal**](BigDecimal.md) @@ -147,8 +163,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterStringSerialize** @@ -165,8 +182,11 @@ Test serialization of outer string types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String body = "body_example"; // String | Input string as post body + +String body = ; // String | Input string as post body + try { String result = apiInstance.fakeOuterStringSerialize(body); System.out.println(result); @@ -182,6 +202,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**String**](String.md)| Input string as post body | [optional] + ### Return type **String** @@ -192,12 +213,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -210,10 +232,13 @@ To test \"client\" model //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +250,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -240,9 +266,10 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + # **testEndpointParameters** -> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) +> testEndpointParameters(body) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -251,36 +278,17 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### 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.FakeApi; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure HTTP basic authorization: http_basic_test -HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); -http_basic_test.setUsername("YOUR USERNAME"); -http_basic_test.setPassword("YOUR PASSWORD"); 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 -Integer integer = 56; // Integer | None -Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None -Float _float = 3.4F; // Float | None -String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None -LocalDate date = new LocalDate(); // LocalDate | None -OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None -String password = "password_example"; // String | None -String paramCallback = "paramCallback_example"; // String | None + +Object body = ; // Object | + try { - apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + apiInstance.testEndpointParameters(body); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEndpointParameters"); e.printStackTrace(); @@ -291,20 +299,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **BigDecimal**| None | - **_double** | **Double**| None | - **patternWithoutDelimiter** | **String**| None | - **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] - **int64** | **Long**| None | [optional] - **_float** | **Float**| None | [optional] - **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] - **date** | **LocalDate**| None | [optional] - **dateTime** | **OffsetDateTime**| None | [optional] - **password** | **String**| None | [optional] - **paramCallback** | **String**| None | [optional] + **body** | [**Object**](Object.md)| | + ### Return type @@ -317,11 +313,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 + - **Accept**: Not defined + # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger) To test enum parameters @@ -334,17 +331,23 @@ To test enum parameters //import io.swagger.client.api.FakeApi; + 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) + +Object body = ; // Object | + List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) -String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + +String enumHeaderString = Arrays.asList("enumHeaderString_example"); // 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) + +String enumQueryString = Arrays.asList("enumQueryString_example"); // String | Query parameter enum test (string) + +Integer enumQueryInteger = Arrays.asList(56); // Integer | Query parameter enum test (double) + try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -355,14 +358,13 @@ 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] + **body** | [**Object**](Object.md)| | [optional] + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: ] + **enumHeaderString** | [**String**](.md)| Header parameter enum test (string) | [optional] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: ] + **enumQueryString** | [**String**](.md)| Query parameter enum test (string) | [optional] + **enumQueryInteger** | [**Integer**](.md)| Query parameter enum test (double) | [optional] + ### Return type @@ -375,16 +377,15 @@ No authorization required ### HTTP request headers - **Content-Type**: */* - - **Accept**: */* + - **Accept**: Not defined + # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(body) test inline additionalProperties - - ### Example ```java // Import classes: @@ -392,10 +393,13 @@ test inline additionalProperties //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body + +Map body = ; // Map | request body + try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(body); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); e.printStackTrace(); @@ -406,7 +410,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **body** | [**Map<String, String>**](Map.md)| request body | + ### Return type @@ -421,14 +426,13 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined + # **testJsonFormData** -> testJsonFormData(param, param2) +> testJsonFormData(body) test json serialization of form data - - ### Example ```java // Import classes: @@ -436,11 +440,13 @@ test json serialization of form data //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String param = "param_example"; // String | field1 -String param2 = "param2_example"; // String | field2 + +Object body = ; // Object | + try { - apiInstance.testJsonFormData(param, param2); + apiInstance.testJsonFormData(body); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testJsonFormData"); e.printStackTrace(); @@ -451,8 +457,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **String**| field1 | - **param2** | **String**| field2 | + **body** | [**Object**](Object.md)| | + ### Return type @@ -467,3 +473,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined + + diff --git a/samples/client/petstore/java/jersey1/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/jersey1/docs/FakeClassnameTags123Api.md index bc728bfce5b..2bcbbb7908f 100644 --- a/samples/client/petstore/java/jersey1/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/jersey1/docs/FakeClassnameTags123Api.md @@ -7,33 +7,28 @@ Method | HTTP request | Description [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case ### 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.FakeClassnameTags123Api; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure API key authorization: api_key_query -ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); -api_key_query.setApiKey("YOUR API KEY"); -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model + +Client 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 +40,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -60,3 +56,5 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + + 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..bc11b93cb26 100644 --- a/samples/client/petstore/java/jersey1/docs/FormatTest.md +++ b/samples/client/petstore/java/jersey1/docs/FormatTest.md @@ -11,8 +11,8 @@ Name | Type | Description | Notes **_float** | **Float** | | [optional] **_double** | **Double** | | [optional] **string** | **String** | | [optional] -**_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**_byte** | **String** | | +**binary** | **String** | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] @@ -20,3 +20,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey1/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/jersey1/docs/HasOnlyReadOnly.md index c1d0aac5672..5564ddcf28a 100644 --- a/samples/client/petstore/java/jersey1/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/java/jersey1/docs/HasOnlyReadOnly.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey1/docs/MapTest.md b/samples/client/petstore/java/jersey1/docs/MapTest.md index 714a97a40d9..74a6fe8ae70 100644 --- a/samples/client/petstore/java/jersey1/docs/MapTest.md +++ b/samples/client/petstore/java/jersey1/docs/MapTest.md @@ -8,12 +8,11 @@ Name | Type | Description | Notes **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] + ## Enum: Map<String, InnerEnum> Name | Value ---- | ----- -UPPER | "UPPER" -LOWER | "lower" diff --git a/samples/client/petstore/java/jersey1/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/jersey1/docs/MixedPropertiesAndAdditionalPropertiesClass.md index b12e2cd70e6..4507481b5a9 100644 --- a/samples/client/petstore/java/jersey1/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/jersey1/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey1/docs/Model200Response.md b/samples/client/petstore/java/jersey1/docs/Model200Response.md index 5b3a9a0e46d..8d2cc50bb83 100644 --- a/samples/client/petstore/java/jersey1/docs/Model200Response.md +++ b/samples/client/petstore/java/jersey1/docs/Model200Response.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey1/docs/ModelApiResponse.md b/samples/client/petstore/java/jersey1/docs/ModelApiResponse.md index 3eec8686cc9..06052b202f1 100644 --- a/samples/client/petstore/java/jersey1/docs/ModelApiResponse.md +++ b/samples/client/petstore/java/jersey1/docs/ModelApiResponse.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey1/docs/ModelReturn.md b/samples/client/petstore/java/jersey1/docs/ModelReturn.md index a679b04953e..a7845ba254b 100644 --- a/samples/client/petstore/java/jersey1/docs/ModelReturn.md +++ b/samples/client/petstore/java/jersey1/docs/ModelReturn.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey1/docs/Name.md b/samples/client/petstore/java/jersey1/docs/Name.md index ce2fb4dee50..a8d6fec9714 100644 --- a/samples/client/petstore/java/jersey1/docs/Name.md +++ b/samples/client/petstore/java/jersey1/docs/Name.md @@ -11,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey1/docs/NumberOnly.md b/samples/client/petstore/java/jersey1/docs/NumberOnly.md index a3feac7fadc..adfb36a95bb 100644 --- a/samples/client/petstore/java/jersey1/docs/NumberOnly.md +++ b/samples/client/petstore/java/jersey1/docs/NumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey1/docs/Order.md b/samples/client/petstore/java/jersey1/docs/Order.md index 268c617d1ff..7e4beff6df1 100644 --- a/samples/client/petstore/java/jersey1/docs/Order.md +++ b/samples/client/petstore/java/jersey1/docs/Order.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/jersey1/docs/OuterComposite.md b/samples/client/petstore/java/jersey1/docs/OuterComposite.md index 3f5a633c998..1963c7a0f73 100644 --- a/samples/client/petstore/java/jersey1/docs/OuterComposite.md +++ b/samples/client/petstore/java/jersey1/docs/OuterComposite.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey1/docs/Pet.md b/samples/client/petstore/java/jersey1/docs/Pet.md index 5b63109ef92..1492195a58d 100644 --- a/samples/client/petstore/java/jersey1/docs/Pet.md +++ b/samples/client/petstore/java/jersey1/docs/Pet.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/jersey1/docs/PetApi.md b/samples/client/petstore/java/jersey1/docs/PetApi.md index b5fa395947d..4758743434a 100644 --- a/samples/client/petstore/java/jersey1/docs/PetApi.md +++ b/samples/client/petstore/java/jersey1/docs/PetApi.md @@ -14,33 +14,28 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image + + # **addPet** -> addPet(body) +> addPet(pet) 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 + +Pet 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 +46,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -64,7 +60,8 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **deletePet** @@ -72,26 +69,20 @@ null (empty response body) 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 | + +Integer petId = Arrays.asList(56); // Integer | Pet id to delete + +String apiKey = Arrays.asList("apiKey_example"); // String | + try { apiInstance.deletePet(petId, apiKey); } catch (ApiException e) { @@ -104,8 +95,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | - **apiKey** | **String**| | [optional] + **petId** | [**Integer**](.md)| Pet id to delete | + **apiKey** | [**String**](.md)| | [optional] + ### Return type @@ -118,7 +110,8 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **findPetsByStatus** @@ -131,20 +124,15 @@ 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); @@ -158,7 +146,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: ] + ### Return type @@ -173,6 +162,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **findPetsByTags** > List<Pet> findPetsByTags(tags) @@ -184,20 +174,15 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### 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); @@ -213,6 +198,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | + ### Return type [**List<Pet>**](Pet.md) @@ -226,6 +212,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **getPetById** > Pet getPetById(petId) @@ -237,22 +224,15 @@ 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to return + try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -266,7 +246,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to return | + **petId** | [**Integer**](.md)| ID of pet to return | + ### Return type @@ -281,33 +262,27 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **updatePet** -> updatePet(body) +> updatePet(pet) 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 + +Pet 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 +293,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -331,37 +307,31 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updatePetWithForm** -> updatePetWithForm(petId, name, status) +> updatePetWithForm(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet that needs to be updated + +Object body = ; // Object | + try { - apiInstance.updatePetWithForm(petId, name, status); + apiInstance.updatePetWithForm(petId, body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePetWithForm"); e.printStackTrace(); @@ -372,9 +342,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet that needs to be updated | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -387,37 +357,31 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **uploadFile** -> ModelApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to update + +Object body = ; // Object | + try { - ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); + ModelApiResponse result = apiInstance.uploadFile(petId, body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFile"); @@ -429,9 +393,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet to update | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -446,3 +410,5 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json + + diff --git a/samples/client/petstore/java/jersey1/docs/ReadOnlyFirst.md b/samples/client/petstore/java/jersey1/docs/ReadOnlyFirst.md index 426b7cde95a..57655e5b49e 100644 --- a/samples/client/petstore/java/jersey1/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/java/jersey1/docs/ReadOnlyFirst.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey1/docs/SpecialModelName.md b/samples/client/petstore/java/jersey1/docs/SpecialModelName.md index c2c6117c552..f4259d2a73c 100644 --- a/samples/client/petstore/java/jersey1/docs/SpecialModelName.md +++ b/samples/client/petstore/java/jersey1/docs/SpecialModelName.md @@ -4,7 +4,8 @@ ## 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..a4678ee745c 100644 --- a/samples/client/petstore/java/jersey1/docs/StoreApi.md +++ b/samples/client/petstore/java/jersey1/docs/StoreApi.md @@ -10,6 +10,8 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + # **deleteOrder** > deleteOrder(orderId) @@ -25,8 +27,11 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + +String orderId = Arrays.asList("orderId_example"); // String | ID of the order that needs to be deleted + try { apiInstance.deleteOrder(orderId); } catch (ApiException e) { @@ -39,7 +44,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | + **orderId** | [**String**](.md)| ID of the order that needs to be deleted | + ### Return type @@ -52,7 +58,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getInventory** @@ -65,21 +72,13 @@ 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); @@ -92,6 +91,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type **Map<String, Integer>** @@ -105,6 +105,7 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json + # **getOrderById** > Order getOrderById(orderId) @@ -120,8 +121,11 @@ For valid response try integer IDs with value <= 5 or > 10. Other val //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched + +Integer orderId = Arrays.asList(56); // Integer | ID of pet that needs to be fetched + try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +139,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | [**Integer**](.md)| ID of pet that needs to be fetched | + ### Return type @@ -150,14 +155,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -165,10 +169,13 @@ Place an order for a pet //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet + +Order 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 +187,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](.md)| order placed for purchasing the pet | + ### Return type @@ -192,6 +200,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: */* - **Accept**: application/xml, application/json + + diff --git a/samples/client/petstore/java/jersey1/docs/Tag.md b/samples/client/petstore/java/jersey1/docs/Tag.md index de6814b55d5..7a97d4c6812 100644 --- a/samples/client/petstore/java/jersey1/docs/Tag.md +++ b/samples/client/petstore/java/jersey1/docs/Tag.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey1/docs/User.md b/samples/client/petstore/java/jersey1/docs/User.md index 8b6753dd284..cf7f9ce1312 100644 --- a/samples/client/petstore/java/jersey1/docs/User.md +++ b/samples/client/petstore/java/jersey1/docs/User.md @@ -15,3 +15,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey1/docs/UserApi.md b/samples/client/petstore/java/jersey1/docs/UserApi.md index 2e6987951c8..e421376ce79 100644 --- a/samples/client/petstore/java/jersey1/docs/UserApi.md +++ b/samples/client/petstore/java/jersey1/docs/UserApi.md @@ -14,9 +14,11 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + # **createUser** -> createUser(body) +> createUser(user) Create user @@ -29,10 +31,13 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object + +User 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 +48,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](.md)| Created user object | + ### Return type @@ -55,8 +61,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithArrayInput** @@ -64,8 +71,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -73,8 +78,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -89,6 +97,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type null (empty response body) @@ -99,8 +108,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithListInput** @@ -108,8 +118,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -117,8 +125,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { @@ -133,6 +144,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type null (empty response body) @@ -143,8 +155,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **deleteUser** @@ -161,8 +174,11 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be deleted + +String username = Arrays.asList("username_example"); // String | The name that needs to be deleted + try { apiInstance.deleteUser(username); } catch (ApiException e) { @@ -175,7 +191,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | + **username** | [**String**](.md)| The name that needs to be deleted | + ### Return type @@ -188,7 +205,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getUserByName** @@ -196,8 +214,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -205,8 +221,11 @@ Get user by user name //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. + +String username = Arrays.asList("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 +239,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + **username** | [**String**](.md)| The name that needs to be fetched. Use user1 for testing. | + ### Return type @@ -235,14 +255,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **loginUser** > String loginUser(username, password) Logs user into the system - - ### Example ```java // Import classes: @@ -250,9 +269,13 @@ Logs user into the system //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 + +String username = Arrays.asList("username_example"); // String | The user name for login + +String password = Arrays.asList("password_example"); // String | The password for login in clear text + try { String result = apiInstance.loginUser(username, password); System.out.println(result); @@ -266,8 +289,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | + **username** | [**String**](.md)| The user name for login | + **password** | [**String**](.md)| The password for login in clear text | + ### Return type @@ -282,14 +306,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **logoutUser** > logoutUser() Logs out current logged in user session - - ### Example ```java // Import classes: @@ -297,7 +320,9 @@ Logs out current logged in user session //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); + try { apiInstance.logoutUser(); } catch (ApiException e) { @@ -309,6 +334,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type null (empty response body) @@ -320,11 +346,12 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updateUser** -> updateUser(username, body) +> updateUser(user, username) Updated user @@ -337,11 +364,15 @@ This can only be done by the logged in user. //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 + +User user = ; // User | Updated user object + +String username = Arrays.asList("username_example"); // String | name that need to be deleted + try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(user, username); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -352,8 +383,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](.md)| Updated user object | + **username** | [**String**](.md)| name that need to be deleted | + ### Return type @@ -365,6 +397,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + + diff --git a/samples/client/petstore/java/jersey1/git_push.sh b/samples/client/petstore/java/jersey1/git_push.sh index ae01b182ae9..ed374619b13 100644 --- a/samples/client/petstore/java/jersey1/git_push.sh +++ b/samples/client/petstore/java/jersey1/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 credential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential 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/jersey1/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/jersey1/gradle/wrapper/gradle-wrapper.jar index 2c6137b8789..e69de29bb2d 100644 Binary files a/samples/client/petstore/java/jersey1/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/jersey1/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/jersey1/pom.xml b/samples/client/petstore/java/jersey1/pom.xml index 2ede717dbdb..b3e957f02c6 100644 --- a/samples/client/petstore/java/jersey1/pom.xml +++ b/samples/client/petstore/java/jersey1/pom.xml @@ -1,267 +1,261 @@ - 4.0.0 - io.swagger - swagger-java-client - jar - swagger-java-client - 1.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-java-client + jar + swagger-java-client + 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 - 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 + - - - 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 - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - 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-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.2 + + + + jar + test-jar + + + + + + - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + 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.7 + 1.7 + + + + + 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 + + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - 1.10 - - - 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.7 - 1.7 - - - - 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 + + + + - + + + - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - + + + io.swagger + swagger-annotations + ${swagger-annotations-version} + - - - io.swagger - swagger-annotations - ${swagger-annotations-version} - + + + com.sun.jersey + jersey-client + ${jersey-version} + + + com.sun.jersey.contribs + jersey-multipart + ${jersey-version} + - - - com.sun.jersey - jersey-client - ${jersey-version} - - - com.sun.jersey.contribs - jersey-multipart - ${jersey-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.jaxrs + jackson-jaxrs-json-provider + ${jackson-version} + + + + + + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-version} + + + + + + com.brsanthu + migbase64 + 2.2 + + + - - - 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.jaxrs - jackson-jaxrs-json-provider - ${jackson-version} - - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-version} - - - - com.brsanthu - migbase64 - 2.2 - - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.5.15 - 1.19.4 - 2.6.4 - 1.0.0 - 4.12 - + + + + junit + junit + ${junit-version} + test + + + + UTF-8 + 1.5.15 + 1.19.4 + + 2.6.4 + 1.0.0 + 4.12 + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java index af34d858267..e3d1c30cefe 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java @@ -12,11 +12,17 @@ package io.swagger.client; + import org.threeten.bp.*; + import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; + + + import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; + import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider; import com.sun.jersey.api.client.Client; @@ -80,11 +86,15 @@ public ApiClient() { objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); objectMapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); objectMapper.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); objectMapper.registerModule(module); + objectMapper.setDateFormat(ApiClient.buildDefaultDateFormat()); dateFormat = ApiClient.buildDefaultDateFormat(); 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..3b624f454ba 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 @@ -29,6 +29,7 @@ import java.util.Map; + public class AnotherFakeApi { private ApiClient apiClient; @@ -49,18 +50,16 @@ public void setApiClient(ApiClient apiClient) { } /** - * To test special tags - * To test special tags - * @param body client model (required) + * To test special tags* To test special tags* @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 @@ -72,9 +71,12 @@ public Client testSpecialTags(Client body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/json" }; @@ -87,7 +89,11 @@ public Client testSpecialTags(Client body) throws ApiException { String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + } + 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..8720a099498 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,8 +22,6 @@ 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; @@ -33,6 +31,7 @@ import java.util.Map; + public class FakeApi { private ApiClient apiClient; @@ -53,9 +52,7 @@ public void setApiClient(ApiClient apiClient) { } /** - * - * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) + * * Test serialization of outer boolean types* @param body Input boolean as post body (optional) * @return Boolean * @throws ApiException if fails to make API call */ @@ -71,33 +68,36 @@ public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } /** - * - * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * * Test serialization of object with outer number type* @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"; @@ -108,28 +108,31 @@ public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Ap Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } /** - * - * Test serialization of outer number types - * @param body Input number as post body (optional) + * * Test serialization of outer number types* @param body Input number as post body (optional) * @return BigDecimal * @throws ApiException if fails to make API call */ @@ -145,28 +148,31 @@ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } /** - * - * Test serialization of outer string types - * @param body Input string as post body (optional) + * * Test serialization of outer string types* @param body Input string as post body (optional) * @return String * @throws ApiException if fails to make API call */ @@ -182,37 +188,40 @@ public String fakeOuterStringSerialize(String body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } /** - * To test \"client\" model - * To test \"client\" model - * @param body client model (required) + * To test \"client\" model* To test \"client\" model* @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 @@ -224,9 +233,12 @@ public Client testClientModel(Client body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/json" }; @@ -239,49 +251,21 @@ public Client testClientModel(Client body) throws ApiException { String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @param body (required) * @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 { - Object localVarPostBody = null; - - // verify the required parameter 'number' is set - if (number == null) { - throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters"); - } - - // verify the required parameter '_double' is set - if (_double == null) { - throw new ApiException(400, "Missing the required parameter '_double' when calling testEndpointParameters"); - } - - // verify the required parameter 'patternWithoutDelimiter' is set - if (patternWithoutDelimiter == null) { - throw new ApiException(400, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); - } + public void testEndpointParameters(Object body) throws ApiException { + Object localVarPostBody = body; - // verify the required parameter '_byte' is set - if (_byte == null) { - throw new ApiException(400, "Missing the required parameter '_byte' when calling testEndpointParameters"); + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testEndpointParameters"); } // create path and map variables @@ -293,39 +277,14 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + - if (integer != null) - localVarFormParams.put("integer", integer); -if (int32 != null) - localVarFormParams.put("int32", int32); -if (int64 != null) - localVarFormParams.put("int64", int64); -if (number != null) - localVarFormParams.put("number", number); -if (_float != null) - localVarFormParams.put("float", _float); -if (_double != null) - localVarFormParams.put("double", _double); -if (string != null) - localVarFormParams.put("string", string); -if (patternWithoutDelimiter != null) - localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter); -if (_byte != null) - localVarFormParams.put("byte", _byte); -if (binary != null) - localVarFormParams.put("binary", binary); -if (date != null) - localVarFormParams.put("date", date); -if (dateTime != null) - localVarFormParams.put("dateTime", dateTime); -if (password != null) - localVarFormParams.put("password", password); -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); @@ -336,24 +295,21 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat String[] localVarAuthNames = new String[] { "http_basic_test" }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, 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) + * To test enum parameters* To test enum parameters* @param body (optional) * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumHeaderString Header parameter enum test (string) (optional) * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryString Query parameter enum test (string) (optional) * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (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 { - Object localVarPostBody = null; + public void testEnumParameters(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger) throws ApiException { + Object localVarPostBody = body; // create path and map variables String localVarPath = "/fake"; @@ -364,24 +320,24 @@ public void testEnumParameters(List enumFormStringArray, String enumForm Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray)); + + localVarQueryParams.addAll(apiClient.parameterToPair("enum_query_string_array", enumQueryStringArray)); + localVarQueryParams.addAll(apiClient.parameterToPair("enum_query_string", enumQueryString)); + localVarQueryParams.addAll(apiClient.parameterToPair("enum_query_integer", enumQueryInteger)); + if (enumHeaderStringArray != null) localVarHeaderParams.put("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); -if (enumHeaderString != null) + if (enumHeaderString != null) localVarHeaderParams.put("enum_header_string", apiClient.parameterToString(enumHeaderString)); + - 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); + final String[] localVarAccepts = { - "*/*" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -392,21 +348,20 @@ public void testEnumParameters(List enumFormStringArray, String enumForm String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } /** - * test inline additionalProperties - * - * @param param request body (required) + * test inline additionalProperties* * @param body request body (required) * @throws ApiException if fails to make API call */ - public void testInlineAdditionalProperties(Object param) throws ApiException { - Object localVarPostBody = param; + public void testInlineAdditionalProperties(Map body) throws ApiException { + Object localVarPostBody = body; - // 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 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testInlineAdditionalProperties"); } // create path and map variables @@ -418,9 +373,12 @@ public void testInlineAdditionalProperties(Object param) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { }; @@ -433,27 +391,20 @@ public void testInlineAdditionalProperties(Object param) throws ApiException { String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } /** - * test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) + * test json serialization of form data* * @param body (required) * @throws ApiException if fails to make API call */ - public void testJsonFormData(String param, String param2) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'param' is set - if (param == null) { - throw new ApiException(400, "Missing the required parameter 'param' when calling testJsonFormData"); - } + public void testJsonFormData(Object body) throws ApiException { + Object localVarPostBody = body; - // verify the required parameter 'param2' is set - if (param2 == null) { - throw new ApiException(400, "Missing the required parameter 'param2' when calling testJsonFormData"); + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testJsonFormData"); } // create path and map variables @@ -465,12 +416,11 @@ public void testJsonFormData(String param, String param2) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + - if (param != null) - localVarFormParams.put("param", param); -if (param2 != null) - localVarFormParams.put("param2", param2); final String[] localVarAccepts = { @@ -484,7 +434,10 @@ public void testJsonFormData(String param, String param2) throws ApiException { String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + } + 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 6c847ecf49b..4340607e7ba 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 @@ -29,6 +29,7 @@ import java.util.Map; + public class FakeClassnameTags123Api { private ApiClient apiClient; @@ -49,18 +50,16 @@ public void setApiClient(ApiClient apiClient) { } /** - * 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 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 @@ -72,9 +71,12 @@ public Client testClassname(Client body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/json" }; @@ -87,7 +89,11 @@ public Client testClassname(Client body) throws ApiException { String[] localVarAuthNames = new String[] { "api_key_query" }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + } + 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..9d36435a6b7 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 @@ -20,7 +20,6 @@ import io.swagger.client.model.*; import io.swagger.client.Pair; -import java.io.File; import io.swagger.client.model.ModelApiResponse; import io.swagger.client.model.Pet; @@ -31,6 +30,7 @@ import java.util.Map; + public class PetApi { private ApiClient apiClient; @@ -51,17 +51,15 @@ public void setApiClient(ApiClient apiClient) { } /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) + * Add a new pet to the store* * @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 @@ -73,11 +71,14 @@ public void addPet(Pet body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -88,17 +89,16 @@ public void addPet(Pet body) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } /** - * Deletes a pet - * - * @param petId Pet id to delete (required) + * Deletes a pet* * @param petId Pet id to delete (required) * @param apiKey (optional) * @throws ApiException if fails to make API call */ - public void deletePet(Long petId, String apiKey) throws ApiException { + public void deletePet(Integer petId, String apiKey) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'petId' is set @@ -116,13 +116,16 @@ public void deletePet(Long petId, String apiKey) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (apiKey != null) localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey)); + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -133,13 +136,12 @@ public void deletePet(Long petId, String apiKey) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; - + apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter (required) + * Finds Pets by status* Multiple status values can be provided with comma separated strings* @param status Status values that need to be considered for filter (required) * @return List<Pet> * @throws ApiException if fails to make API call */ @@ -160,10 +162,14 @@ public List findPetsByStatus(List status) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status)); + + localVarQueryParams.addAll(apiClient.parameterToPair("status", status)); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -176,13 +182,13 @@ public List findPetsByStatus(List status) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; + GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by (required) + * Finds Pets by tags* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.* @param tags Tags to filter by (required) * @return List<Pet> * @throws ApiException if fails to make API call * @deprecated @@ -205,10 +211,14 @@ public List findPetsByTags(List tags) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags)); + + localVarQueryParams.addAll(apiClient.parameterToPair("tags", tags)); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -221,17 +231,17 @@ public List findPetsByTags(List tags) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; + GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return (required) + * Find pet by ID* Returns a single pet* @param petId ID of pet to return (required) * @return Pet * @throws ApiException if fails to make API call */ - public Pet getPetById(Long petId) throws ApiException { + public Pet getPetById(Integer petId) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'petId' is set @@ -249,9 +259,12 @@ public Pet getPetById(Long petId) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -264,21 +277,21 @@ public Pet getPetById(Long petId) throws ApiException { String[] localVarAuthNames = new String[] { "api_key" }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) + * Update an existing pet* * @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 @@ -290,11 +303,14 @@ public void updatePet(Pet body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -305,19 +321,17 @@ public void updatePet(Pet body) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; - + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) + * Updates a pet in the store with form data* * @param petId ID of pet that needs to be updated (required) + * @param body (optional) * @throws ApiException if fails to make API call */ - public void updatePetWithForm(Long petId, String name, String status) throws ApiException { - Object localVarPostBody = null; + public void updatePetWithForm(Integer petId, Object body) throws ApiException { + Object localVarPostBody = body; // verify the required parameter 'petId' is set if (petId == null) { @@ -334,15 +348,14 @@ public void updatePetWithForm(Long petId, String name, String status) throws Api Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + - if (name != null) - localVarFormParams.put("name", name); -if (status != null) - localVarFormParams.put("status", status); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -353,20 +366,18 @@ public void updatePetWithForm(Long petId, String name, String status) throws Api String[] localVarAuthNames = new String[] { "petstore_auth" }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } /** - * uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) + * uploads an image* * @param petId ID of pet to update (required) + * @param body (optional) * @return ModelApiResponse * @throws ApiException if fails to make API call */ - public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException { - Object localVarPostBody = null; + public ModelApiResponse uploadFile(Integer petId, Object body) throws ApiException { + Object localVarPostBody = body; // verify the required parameter 'petId' is set if (petId == null) { @@ -383,12 +394,11 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + - if (additionalMetadata != null) - localVarFormParams.put("additionalMetadata", additionalMetadata); -if (file != null) - localVarFormParams.put("file", file); final String[] localVarAccepts = { "application/json" @@ -402,7 +412,11 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f String[] localVarAuthNames = new String[] { "petstore_auth" }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + } + 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..60137eeaac4 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 @@ -29,6 +29,7 @@ import java.util.Map; + public class StoreApi { private ApiClient apiClient; @@ -49,9 +50,7 @@ public void setApiClient(ApiClient apiClient) { } /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted (required) + * Delete purchase order by ID* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors* @param orderId ID of the order that needs to be deleted (required) * @throws ApiException if fails to make API call */ public void deleteOrder(String orderId) throws ApiException { @@ -72,11 +71,14 @@ public void deleteOrder(String orderId) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -87,13 +89,12 @@ public void deleteOrder(String orderId) throws ApiException { String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return Map<String, Integer> + * Returns pet inventories by status* Returns a map of status codes to quantities* @return Map<String, Integer> * @throws ApiException if fails to make API call */ public Map getInventory() throws ApiException { @@ -108,9 +109,12 @@ public Map getInventory() throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/json" }; @@ -123,17 +127,17 @@ public Map getInventory() throws ApiException { String[] localVarAuthNames = new String[] { "api_key" }; + GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched (required) + * Find purchase order by ID* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions* @param orderId ID of pet that needs to be fetched (required) * @return Order * @throws ApiException if fails to make API call */ - public Order getOrderById(Long orderId) throws ApiException { + public Order getOrderById(Integer orderId) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'orderId' is set @@ -151,9 +155,12 @@ public Order getOrderById(Long orderId) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -166,22 +173,22 @@ public Order getOrderById(Long orderId) throws ApiException { String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet (required) + * Place an order for a pet* * @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 @@ -193,22 +200,29 @@ public Order placeOrder(Order body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + } + 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 05b9c65bf44..2a7e16ab6e3 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 @@ -29,6 +29,7 @@ import java.util.Map; + public class UserApi { private ApiClient apiClient; @@ -49,17 +50,15 @@ public void setApiClient(ApiClient apiClient) { } /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object (required) + * Create user* This can only be done by the logged in user.* @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 @@ -71,28 +70,30 @@ public void createUser(User body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } /** - * Creates list of users with given input array - * - * @param body List of user object (required) + * Creates list of users with given input array* * @param body List of user object (required) * @throws ApiException if fails to make API call */ public void createUsersWithArrayInput(List body) throws ApiException { @@ -112,28 +113,30 @@ public void createUsersWithArrayInput(List body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } /** - * Creates list of users with given input array - * - * @param body List of user object (required) + * Creates list of users with given input array* * @param body List of user object (required) * @throws ApiException if fails to make API call */ public void createUsersWithListInput(List body) throws ApiException { @@ -153,28 +156,30 @@ public void createUsersWithListInput(List body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted (required) + * Delete user* This can only be done by the logged in user.* @param username The name that needs to be deleted (required) * @throws ApiException if fails to make API call */ public void deleteUser(String username) throws ApiException { @@ -195,11 +200,14 @@ public void deleteUser(String username) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -210,13 +218,12 @@ public void deleteUser(String username) throws ApiException { String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) + * Get user by user name* * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return User * @throws ApiException if fails to make API call */ @@ -238,9 +245,12 @@ public User getUserByName(String username) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -253,13 +263,13 @@ public User getUserByName(String username) throws ApiException { String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } /** - * Logs user into the system - * - * @param username The user name for login (required) + * Logs user into the system* * @param username The user name for login (required) * @param password The password for login in clear text (required) * @return String * @throws ApiException if fails to make API call @@ -286,11 +296,16 @@ public String loginUser(String username, String password) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPair("username", username)); + localVarQueryParams.addAll(apiClient.parameterToPair("password", password)); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -303,13 +318,13 @@ public String loginUser(String username, String password) throws ApiException { String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } /** - * Logs out current logged in user session - * - * @throws ApiException if fails to make API call + * Logs out current logged in user session* * @throws ApiException if fails to make API call */ public void logoutUser() throws ApiException { Object localVarPostBody = null; @@ -323,11 +338,14 @@ public void logoutUser() throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -338,29 +356,28 @@ public void logoutUser() throws ApiException { String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } /** - * Updated user - * This can only be done by the logged in user. + * Updated user* This can only be done by the logged in user.* @param user Updated user object (required) * @param username name that need to be deleted (required) - * @param body 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(User user, String username) throws ApiException { + Object localVarPostBody = user; + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser"); + } // 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"); - } - // create path and map variables String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); @@ -371,22 +388,28 @@ public void updateUser(String username, User body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + } + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/auth/HttpBasicAuth.java index 788b63a9918..44f4f86e490 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/auth/HttpBasicAuth.java @@ -15,14 +15,19 @@ import io.swagger.client.Pair; + import com.migcomponents.migbase64.Base64; + + import java.util.Map; import java.util.List; + import java.io.UnsupportedEncodingException; + public class HttpBasicAuth implements Authentication { private String username; private String password; @@ -49,10 +54,13 @@ public void applyToParams(List queryParams, Map headerPara return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + try { headerParams.put("Authorization", "Basic " + Base64.encodeToString(str.getBytes("UTF-8"), false)); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } + + } } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 7fe69e168fd..c226acf8619 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -28,65 +28,65 @@ */ public class AdditionalPropertiesClass { + @JsonProperty("map_property") private Map mapProperty = null; - + @JsonProperty("map_of_map_property") private Map> mapOfMapProperty = null; - + public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; return this; } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { this.mapProperty = new HashMap(); } + this.mapProperty.put(key, mapPropertyItem); return this; } - - /** - * Get mapProperty - * @return mapProperty + /** + * Get mapProperty + * @return mapProperty **/ @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } - public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } - + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; return this; } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { this.mapOfMapProperty = new HashMap>(); } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } - - /** - * Get mapOfMapProperty - * @return mapOfMapProperty + /** + * Get mapOfMapProperty + * @return mapOfMapProperty **/ @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -104,8 +104,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapProperty, mapOfMapProperty); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -128,5 +127,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Animal.java index 590f36c0ae0..ddd1f98533f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Animal.java @@ -25,56 +25,60 @@ /** * Animal */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true ) + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Discriminator{propertyName='className', mapping=null}", visible = true ) @JsonSubTypes({ + @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + }) public class Animal { + @JsonProperty("className") private String className = null; - + @JsonProperty("color") private String color = "red"; - + public Animal className(String className) { this.className = className; return this; } - /** - * Get className - * @return className + + /** + * Get className + * @return className **/ @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } - public void setClassName(String className) { this.className = className; } - + public Animal color(String color) { this.color = color; return this; } - /** - * Get color - * @return color + + /** + * Get color + * @return color **/ @ApiModelProperty(value = "") public String getColor() { return color; } - public void setColor(String color) { this.color = color; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -92,8 +96,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(className, color); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -116,5 +119,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AnimalFarm.java deleted file mode 100644 index 0b1d6a74cc6..00000000000 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/AnimalFarm.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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 io.swagger.client.model.Animal; -import java.util.ArrayList; -import java.util.List; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index b7e59a030a4..380b98b1f70 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -28,36 +28,37 @@ */ public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") private List> arrayArrayNumber = null; - + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; return this; } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { this.arrayArrayNumber = new ArrayList>(); } + this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber **/ @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } - public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,8 +75,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayArrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -97,5 +97,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index fdfeb6856f3..482a3177a15 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -28,36 +28,37 @@ */ public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") private List arrayNumber = null; - + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; return this; } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { this.arrayNumber = new ArrayList(); } + this.arrayNumber.add(arrayNumberItem); return this; } - - /** - * Get arrayNumber - * @return arrayNumber + + /** + * Get arrayNumber + * @return arrayNumber **/ @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } - public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,8 +75,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -97,5 +97,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayTest.java index 62665c2536a..e70233c3c7f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ArrayTest.java @@ -28,94 +28,97 @@ */ public class ArrayTest { + @JsonProperty("array_of_string") private List arrayOfString = null; - + @JsonProperty("array_array_of_integer") private List> arrayArrayOfInteger = null; - + @JsonProperty("array_array_of_model") private List> arrayArrayOfModel = null; - + public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; return this; } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { this.arrayOfString = new ArrayList(); } + this.arrayOfString.add(arrayOfStringItem); return this; } - - /** - * Get arrayOfString - * @return arrayOfString + + /** + * Get arrayOfString + * @return arrayOfString **/ @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } - public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } - + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { this.arrayArrayOfInteger = new ArrayList>(); } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger **/ @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } - + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { this.arrayArrayOfModel = new ArrayList>(); } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel **/ @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } - public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -134,8 +137,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -159,5 +161,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Capitalization.java index a72b0a72f46..f534657b4ca 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Capitalization.java @@ -25,133 +25,133 @@ */ public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel = null; - + @JsonProperty("CapitalCamel") private String capitalCamel = null; - + @JsonProperty("small_Snake") private String smallSnake = null; - + @JsonProperty("Capital_Snake") private String capitalSnake = null; - + @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints = null; - + @JsonProperty("ATT_NAME") private String ATT_NAME = null; - + public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; return this; } - /** - * Get smallCamel - * @return smallCamel + + /** + * Get smallCamel + * @return smallCamel **/ @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } - public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } - + public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; return this; } - /** - * Get capitalCamel - * @return capitalCamel + + /** + * Get capitalCamel + * @return capitalCamel **/ @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } - public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } - + public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; return this; } - /** - * Get smallSnake - * @return smallSnake + + /** + * Get smallSnake + * @return smallSnake **/ @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } - public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } - + public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; return this; } - /** - * Get capitalSnake - * @return capitalSnake + + /** + * Get capitalSnake + * @return capitalSnake **/ @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } - public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } - + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; return this; } - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints **/ @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } - public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } - + public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; return this; } - /** - * Name of the pet - * @return ATT_NAME + + /** + * Name of the pet + * @return ATT_NAME **/ @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } - public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -173,8 +173,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -201,5 +200,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Cat.java index b882da0ad90..d6e94912f06 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Cat.java @@ -26,28 +26,70 @@ */ public class Cat extends Animal { + + @JsonProperty("className") + private String className = null; + + @JsonProperty("color") + private String color = "red"; + @JsonProperty("declawed") private Boolean declawed = null; + + public Cat className(String className) { + this.className = className; + return this; + } + + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Cat color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; } - /** - * Get declawed - * @return declawed + + /** + * Get declawed + * @return declawed **/ @ApiModelProperty(value = "") public Boolean isDeclawed() { return declawed; } - public void setDeclawed(Boolean declawed) { this.declawed = declawed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -57,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && + return Objects.equals(this.className, cat.className) && + Objects.equals(this.color, cat.color) && + Objects.equals(this.declawed, cat.declawed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(declawed, super.hashCode()); + return Objects.hash(className, color, declawed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); sb.append("}"); return sb.toString(); @@ -88,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Category.java index 464f4375c4b..5ef89bf53cf 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Category.java @@ -25,49 +25,49 @@ */ public class Category { + @JsonProperty("id") private Long id = null; - + @JsonProperty("name") private String name = null; - + public Category id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Category name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -85,8 +85,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -109,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ClassModel.java index 4f764fde68d..887733b7310 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ClassModel.java @@ -22,32 +22,31 @@ /** * Model for testing model with \"_class\" property - */ -@ApiModel(description = "Model for testing model with \"_class\" property") + */@ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { + @JsonProperty("_class") private String propertyClass = null; - + public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,8 +63,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -87,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Client.java index a7c4253499c..6193700c6ca 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Client.java @@ -25,28 +25,28 @@ */ public class Client { + @JsonProperty("client") private String client = null; - + public Client client(String client) { this.client = client; return this; } - /** - * Get client - * @return client + + /** + * Get client + * @return client **/ @ApiModelProperty(value = "") public String getClient() { return client; } - public void setClient(String client) { this.client = client; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,8 +63,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(client); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -86,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Dog.java index 7de179b2ade..bffa0917362 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Dog.java @@ -26,28 +26,70 @@ */ public class Dog extends Animal { + + @JsonProperty("className") + private String className = null; + + @JsonProperty("color") + private String color = "red"; + @JsonProperty("breed") private String breed = null; + + public Dog className(String className) { + this.className = className; + return this; + } + + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Dog color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Dog breed(String breed) { this.breed = breed; return this; } - /** - * Get breed - * @return breed + + /** + * Get breed + * @return breed **/ @ApiModelProperty(value = "") public String getBreed() { return breed; } - public void setBreed(String breed) { this.breed = breed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -57,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && + return Objects.equals(this.className, dog.className) && + Objects.equals(this.color, dog.color) && + Objects.equals(this.breed, dog.breed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(breed, super.hashCode()); + return Objects.hash(className, color, breed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); sb.append("}"); return sb.toString(); @@ -88,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java index 12caa480285..e23a220e753 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java @@ -27,12 +27,13 @@ */ public class EnumArrays { - /** + + /** * Gets or Sets justSymbol */ public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), + GREATER_THAN_OR_EQUAL_TO(">="), DOLLAR("$"); private String value; @@ -40,8 +41,9 @@ public enum JustSymbolEnum { JustSymbolEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -50,8 +52,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static JustSymbolEnum fromValue(String text) { for (JustSymbolEnum b : JustSymbolEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -60,17 +63,20 @@ public static JustSymbolEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("just_symbol") private JustSymbolEnum justSymbol = null; - - /** + + + /** * Gets or Sets arrayEnum */ public enum ArrayEnumEnum { - FISH("fish"), + FISH("fish"), CRAB("crab"); private String value; @@ -78,8 +84,9 @@ public enum ArrayEnumEnum { ArrayEnumEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -88,8 +95,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static ArrayEnumEnum fromValue(String text) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -98,56 +106,57 @@ public static ArrayEnumEnum fromValue(String text) { } return null; } + } - + @JsonProperty("array_enum") private List arrayEnum = null; - + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; return this; } - /** - * Get justSymbol - * @return justSymbol + + /** + * Get justSymbol + * @return justSymbol **/ @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } - public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } - + public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; return this; } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { this.arrayEnum = new ArrayList(); } + this.arrayEnum.add(arrayEnumItem); return this; } - - /** - * Get arrayEnum - * @return arrayEnum + + /** + * Get arrayEnum + * @return arrayEnum **/ @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } - public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -165,8 +174,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -189,5 +197,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumClass.java index abbd7a56668..9414211ef6c 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumClass.java @@ -13,14 +13,17 @@ package io.swagger.client.model; -import java.util.Objects; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + + /** * Gets or Sets EnumClass */ + public enum EnumClass { _ABC("_abc"), @@ -35,7 +38,9 @@ public enum EnumClass { this.value = value; } + @JsonValue + public String getValue() { return value; } @@ -45,7 +50,9 @@ public String toString() { return String.valueOf(value); } + @JsonCreator + public static EnumClass fromValue(String text) { for (EnumClass b : EnumClass.values()) { if (String.valueOf(b.value).equals(text)) { @@ -54,5 +61,8 @@ public static EnumClass fromValue(String text) { } return null; } + } + + 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 93d0da037b6..4634e7018db 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 @@ -26,14 +26,14 @@ */ public class EnumTest { - /** + + /** * Gets or Sets enumString */ public enum EnumStringEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"), - EMPTY(""); private String value; @@ -41,8 +41,9 @@ public enum EnumStringEnum { EnumStringEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -51,8 +52,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumStringEnum fromValue(String text) { for (EnumStringEnum b : EnumStringEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -61,17 +63,19 @@ public static EnumStringEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_string") private EnumStringEnum enumString = null; - - /** + + /** * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(1), NUMBER_MINUS_1(-1); private Integer value; @@ -79,8 +83,9 @@ public enum EnumIntegerEnum { EnumIntegerEnum(Integer value) { this.value = value; } - + @JsonValue + public Integer getValue() { return value; } @@ -89,8 +94,9 @@ public Integer getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumIntegerEnum fromValue(String text) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -99,17 +105,19 @@ public static EnumIntegerEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger = null; - - /** + + /** * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(1.1), NUMBER_MINUS_1_DOT_2(-1.2); private Double value; @@ -117,8 +125,9 @@ public enum EnumNumberEnum { EnumNumberEnum(Double value) { this.value = value; } - + @JsonValue + public Double getValue() { return value; } @@ -127,8 +136,9 @@ public Double getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumNumberEnum fromValue(String text) { for (EnumNumberEnum b : EnumNumberEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -137,87 +147,88 @@ public static EnumNumberEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_number") private EnumNumberEnum enumNumber = null; - + @JsonProperty("outerEnum") private OuterEnum outerEnum = null; - + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; } - /** - * Get enumString - * @return enumString + + /** + * Get enumString + * @return enumString **/ @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } - public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } - + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; } - /** - * Get enumInteger - * @return enumInteger + + /** + * Get enumInteger + * @return enumInteger **/ @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } - public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } - + public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; return this; } - /** - * Get enumNumber - * @return enumNumber + + /** + * Get enumNumber + * @return enumNumber **/ @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } - public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - + public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; return this; } - /** - * Get outerEnum - * @return outerEnum + + /** + * Get outerEnum + * @return outerEnum **/ @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -237,8 +248,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -263,5 +273,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\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 4118656d29e..df02f3998d4 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 @@ -29,290 +29,284 @@ */ public class FormatTest { + @JsonProperty("integer") private Integer integer = null; - + @JsonProperty("int32") private Integer int32 = null; - + @JsonProperty("int64") private Long int64 = null; - + @JsonProperty("number") private BigDecimal number = null; - + @JsonProperty("float") private Float _float = null; - + @JsonProperty("double") private Double _double = null; - + @JsonProperty("string") private String string = null; - + @JsonProperty("byte") - private byte[] _byte = null; - + private String _byte = null; + @JsonProperty("binary") - private byte[] binary = null; - + private String binary = null; + @JsonProperty("date") private LocalDate date = null; - + @JsonProperty("dateTime") private OffsetDateTime dateTime = null; - + @JsonProperty("uuid") private UUID uuid = null; - + @JsonProperty("password") private String password = null; - + public FormatTest integer(Integer integer) { this.integer = integer; return this; } - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer **/ @ApiModelProperty(value = "") public Integer getInteger() { return integer; } - public void setInteger(Integer integer) { this.integer = integer; } - + public FormatTest int32(Integer int32) { this.int32 = int32; return this; } - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 **/ @ApiModelProperty(value = "") public Integer getInt32() { return int32; } - public void setInt32(Integer int32) { this.int32 = int32; } - + public FormatTest int64(Long int64) { this.int64 = int64; return this; } - /** - * Get int64 - * @return int64 + + /** + * Get int64 + * @return int64 **/ @ApiModelProperty(value = "") public Long getInt64() { return int64; } - public void setInt64(Long int64) { this.int64 = int64; } - + public FormatTest number(BigDecimal number) { this.number = number; return this; } - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number + + /** + * Get number + * @return number **/ @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } - public void setNumber(BigDecimal number) { this.number = number; } - + public FormatTest _float(Float _float) { this._float = _float; return this; } - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float + + /** + * Get _float + * @return _float **/ @ApiModelProperty(value = "") public Float getFloat() { return _float; } - public void setFloat(Float _float) { this._float = _float; } - + public FormatTest _double(Double _double) { this._double = _double; return this; } - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double + + /** + * Get _double + * @return _double **/ @ApiModelProperty(value = "") public Double getDouble() { return _double; } - public void setDouble(Double _double) { this._double = _double; } - + public FormatTest string(String string) { this.string = string; return this; } - /** - * Get string - * @return string + + /** + * Get string + * @return string **/ @ApiModelProperty(value = "") public String getString() { return string; } - public void setString(String string) { this.string = string; } - - public FormatTest _byte(byte[] _byte) { + + public FormatTest _byte(String _byte) { this._byte = _byte; return this; } - /** - * Get _byte - * @return _byte + + /** + * Get _byte + * @return _byte **/ @ApiModelProperty(required = true, value = "") - public byte[] getByte() { + public String getByte() { return _byte; } - - public void setByte(byte[] _byte) { + public void setByte(String _byte) { this._byte = _byte; } - - public FormatTest binary(byte[] binary) { + + public FormatTest binary(String binary) { this.binary = binary; return this; } - /** - * Get binary - * @return binary + + /** + * Get binary + * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public String getBinary() { return binary; } - - public void setBinary(byte[] binary) { + public void setBinary(String binary) { this.binary = binary; } - + public FormatTest date(LocalDate date) { this.date = date; return this; } - /** - * Get date - * @return date + + /** + * Get date + * @return date **/ @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } - public void setDate(LocalDate date) { this.date = date; } - + public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public FormatTest password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -341,8 +335,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -376,5 +369,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 6dc9f12c4b8..98a721fb9dc 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -25,31 +25,33 @@ */ public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar = null; - + @JsonProperty("foo") private String foo = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - - /** - * Get foo - * @return foo + + + /** + * Get foo + * @return foo **/ @ApiModelProperty(value = "") public String getFoo() { return foo; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,8 +69,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, foo); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -91,5 +92,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java index e6344a1df0f..90ed39f7e3f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java @@ -28,15 +28,17 @@ */ public class MapTest { + @JsonProperty("map_map_of_string") private Map> mapMapOfString = null; - - /** + + + /** * Gets or Sets inner */ public enum InnerEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"); private String value; @@ -44,8 +46,9 @@ public enum InnerEnum { InnerEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -54,8 +57,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static InnerEnum fromValue(String text) { for (InnerEnum b : InnerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -64,64 +68,64 @@ public static InnerEnum fromValue(String text) { } return null; } + } - + @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; - + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { this.mapMapOfString = new HashMap>(); } + this.mapMapOfString.put(key, mapMapOfStringItem); return this; } - - /** - * Get mapMapOfString - * @return mapMapOfString + /** + * Get mapMapOfString + * @return mapMapOfString **/ @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } - public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } - + public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; return this; } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { this.mapOfEnumString = new HashMap(); } + this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } - - /** - * Get mapOfEnumString - * @return mapOfEnumString + /** + * Get mapOfEnumString + * @return mapOfEnumString **/ @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } - public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -139,8 +143,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -163,5 +166,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 29bfc7e8c08..4a8b69780fd 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -31,78 +31,78 @@ */ public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid = null; - + @JsonProperty("dateTime") private OffsetDateTime dateTime = null; - + @JsonProperty("map") private Map map = null; - + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; return this; } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { this.map = new HashMap(); } + this.map.put(key, mapItem); return this; } - - /** - * Get map - * @return map + /** + * Get map + * @return map **/ @ApiModelProperty(value = "") public Map getMap() { return map; } - public void setMap(Map map) { this.map = map; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -121,8 +121,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(uuid, dateTime, map); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -146,5 +145,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 58624475e43..606b051c2ea 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 @@ -22,53 +22,52 @@ /** * Model for testing model name starting with number - */ -@ApiModel(description = "Model for testing model name starting with number") + */@ApiModel(description = "Model for testing model name starting with number") public class Model200Response { + @JsonProperty("name") private Integer name = null; - + @JsonProperty("class") private String propertyClass = null; - + public Model200Response name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - + public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -86,8 +85,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -110,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelApiResponse.java index b010e53b48c..4002f3f632e 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -25,70 +25,70 @@ */ public class ModelApiResponse { + @JsonProperty("code") private Integer code = null; - + @JsonProperty("type") private String type = null; - + @JsonProperty("message") private String message = null; - + public ModelApiResponse code(Integer code) { this.code = code; return this; } - /** - * Get code - * @return code + + /** + * Get code + * @return code **/ @ApiModelProperty(value = "") public Integer getCode() { return code; } - public void setCode(Integer code) { this.code = code; } - + public ModelApiResponse type(String type) { this.type = type; return this; } - /** - * Get type - * @return type + + /** + * Get type + * @return type **/ @ApiModelProperty(value = "") public String getType() { return type; } - public void setType(String type) { this.type = type; } - + public ModelApiResponse message(String message) { this.message = message; return this; } - /** - * Get message - * @return message + + /** + * Get message + * @return message **/ @ApiModelProperty(value = "") public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -107,8 +107,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(code, type, message); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -132,5 +131,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelReturn.java index 27d08557248..685e5ba93ac 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelReturn.java @@ -22,32 +22,31 @@ /** * Model for testing reserved words - */ -@ApiModel(description = "Model for testing reserved words") + */@ApiModel(description = "Model for testing reserved words") public class ModelReturn { + @JsonProperty("return") private Integer _return = null; - + public ModelReturn _return(Integer _return) { this._return = _return; return this; } - /** - * Get _return - * @return _return + + /** + * Get _return + * @return _return **/ @ApiModelProperty(value = "") public Integer getReturn() { return _return; } - public void setReturn(Integer _return) { this._return = _return; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,8 +63,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(_return); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -87,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 f2b9b1703bd..7c94ab233c2 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 @@ -22,77 +22,78 @@ /** * Model for testing model name same as property name - */ -@ApiModel(description = "Model for testing model name same as property name") + */@ApiModel(description = "Model for testing model name same as property name") public class Name { + @JsonProperty("name") private Integer name = null; - + @JsonProperty("snake_case") private Integer snakeCase = null; - + @JsonProperty("property") private String property = null; - + @JsonProperty("123Number") private Integer _123Number = null; - + public Name name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - - /** - * Get snakeCase - * @return snakeCase + + + /** + * Get snakeCase + * @return snakeCase **/ @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } - + public Name property(String property) { this.property = property; return this; } - /** - * Get property - * @return property + + /** + * Get property + * @return property **/ @ApiModelProperty(value = "") public String getProperty() { return property; } - public void setProperty(String property) { this.property = property; } - - /** - * Get _123Number - * @return _123Number + + + /** + * Get _123Number + * @return _123Number **/ @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,8 +113,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, snakeCase, property, _123Number); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -138,5 +138,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/NumberOnly.java index ec93aba0531..dc53f9e50dc 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/NumberOnly.java @@ -26,28 +26,28 @@ */ public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber = null; - + public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; return this; } - /** - * Get justNumber - * @return justNumber + + /** + * Get justNumber + * @return justNumber **/ @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } - public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,8 +64,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -87,5 +86,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java index 6976ceb8fba..0a6d7ad0933 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java @@ -26,26 +26,26 @@ */ public class Order { + @JsonProperty("id") private Long id = null; - + @JsonProperty("petId") private Long petId = null; - + @JsonProperty("quantity") private Integer quantity = null; - + @JsonProperty("shipDate") private OffsetDateTime shipDate = null; - - /** + + /** * Order Status */ public enum StatusEnum { - PLACED("placed"), + PLACED("placed"), APPROVED("approved"), - DELIVERED("delivered"); private String value; @@ -53,8 +53,9 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -63,8 +64,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -73,123 +75,124 @@ public static StatusEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("status") private StatusEnum status = null; - + @JsonProperty("complete") private Boolean complete = false; - + public Order id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Order petId(Long petId) { this.petId = petId; return this; } - /** - * Get petId - * @return petId + + /** + * Get petId + * @return petId **/ @ApiModelProperty(value = "") public Long getPetId() { return petId; } - public void setPetId(Long petId) { this.petId = petId; } - + public Order quantity(Integer quantity) { this.quantity = quantity; return this; } - /** - * Get quantity - * @return quantity + + /** + * Get quantity + * @return quantity **/ @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } - public void setQuantity(Integer quantity) { this.quantity = quantity; } - + public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; return this; } - /** - * Get shipDate - * @return shipDate + + /** + * Get shipDate + * @return shipDate **/ @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } - public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } - + public Order status(StatusEnum status) { this.status = status; return this; } - /** - * Order Status - * @return status + + /** + * Order Status + * @return status **/ @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - + public Order complete(Boolean complete) { this.complete = complete; return this; } - /** - * Get complete - * @return complete + + /** + * Get complete + * @return complete **/ @ApiModelProperty(value = "") public Boolean isComplete() { return complete; } - public void setComplete(Boolean complete) { this.complete = complete; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -211,8 +214,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -239,5 +241,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterComposite.java index 02c16a99b70..8b957f45a14 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterComposite.java @@ -26,70 +26,70 @@ */ public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber = null; - + @JsonProperty("my_string") private String myString = null; - + @JsonProperty("my_boolean") private Boolean myBoolean = null; - + public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; return this; } - /** - * Get myNumber - * @return myNumber + + /** + * Get myNumber + * @return myNumber **/ @ApiModelProperty(value = "") public BigDecimal getMyNumber() { return myNumber; } - public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } - + public OuterComposite myString(String myString) { this.myString = myString; return this; } - /** - * Get myString - * @return myString + + /** + * Get myString + * @return myString **/ @ApiModelProperty(value = "") public String getMyString() { return myString; } - public void setMyString(String myString) { this.myString = myString; } - + public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; return this; } - /** - * Get myBoolean - * @return myBoolean + + /** + * Get myBoolean + * @return myBoolean **/ @ApiModelProperty(value = "") public Boolean getMyBoolean() { return myBoolean; } - public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -108,8 +108,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(myNumber, myString, myBoolean); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -133,5 +132,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterEnum.java index 948d80c2e6d..3390d473c7b 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterEnum.java @@ -13,14 +13,17 @@ package io.swagger.client.model; -import java.util.Objects; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + + /** * Gets or Sets OuterEnum */ + public enum OuterEnum { PLACED("placed"), @@ -35,7 +38,9 @@ public enum OuterEnum { this.value = value; } + @JsonValue + public String getValue() { return value; } @@ -45,7 +50,9 @@ public String toString() { return String.valueOf(value); } + @JsonCreator + public static OuterEnum fromValue(String text) { for (OuterEnum b : OuterEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -54,5 +61,8 @@ public static OuterEnum fromValue(String text) { } return null; } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java index 4c351dec3e4..ab51be3365d 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java @@ -29,29 +29,29 @@ */ public class Pet { + @JsonProperty("id") private Long id = null; - + @JsonProperty("category") private Category category = null; - + @JsonProperty("name") private String name = null; - + @JsonProperty("photoUrls") private List photoUrls = new ArrayList(); - + @JsonProperty("tags") private List tags = null; - - /** + + /** * pet status in the store */ public enum StatusEnum { - AVAILABLE("available"), + AVAILABLE("available"), PENDING("pending"), - SOLD("sold"); private String value; @@ -59,8 +59,9 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -69,8 +70,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -79,133 +81,135 @@ public static StatusEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("status") private StatusEnum status = null; - + public Pet id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Pet category(Category category) { this.category = category; return this; } - /** - * Get category - * @return category + + /** + * Get category + * @return category **/ @ApiModelProperty(value = "") public Category getCategory() { return category; } - public void setCategory(Category category) { this.category = category; } - + public Pet name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - + public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); return this; } - - /** - * Get photoUrls - * @return photoUrls + + /** + * Get photoUrls + * @return photoUrls **/ @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } - + public Pet tags(List tags) { this.tags = tags; return this; } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { this.tags = new ArrayList(); } + this.tags.add(tagsItem); return this; } - - /** - * Get tags - * @return tags + + /** + * Get tags + * @return tags **/ @ApiModelProperty(value = "") public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } - + public Pet status(StatusEnum status) { this.status = status; return this; } - /** - * pet status in the store - * @return status + + /** + * pet status in the store + * @return status **/ @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -227,8 +231,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -255,5 +258,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 76f8a912f36..1532a30b9e9 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -25,40 +25,41 @@ */ public class ReadOnlyFirst { + @JsonProperty("bar") private String bar = null; - + @JsonProperty("baz") private String baz = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; } - /** - * Get baz - * @return baz + + /** + * Get baz + * @return baz **/ @ApiModelProperty(value = "") public String getBaz() { return baz; } - public void setBaz(String baz) { this.baz = baz; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -76,8 +77,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, baz); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,5 +100,8 @@ private String toIndentedString(java.lang.Object o) { 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 784eb8baca8..38b54fd6c38 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 @@ -25,28 +25,28 @@ */ public class SpecialModelName { - @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + @JsonProperty("$special[property.name]") + private Long $specialPropertyName = null; + + 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; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -55,22 +55,21 @@ public boolean equals(java.lang.Object o) { 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); } - - + @Override public String toString() { 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(); } @@ -86,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Tag.java index 1cf2f5bc5e6..2967322b174 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Tag.java @@ -25,49 +25,49 @@ */ public class Tag { + @JsonProperty("id") private Long id = null; - + @JsonProperty("name") private String name = null; - + public Tag id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Tag name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -85,8 +85,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -109,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/User.java index de5bc439c5a..cb2f9f34084 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/User.java @@ -25,175 +25,175 @@ */ public class User { + @JsonProperty("id") private Long id = null; - + @JsonProperty("username") private String username = null; - + @JsonProperty("firstName") private String firstName = null; - + @JsonProperty("lastName") private String lastName = null; - + @JsonProperty("email") private String email = null; - + @JsonProperty("password") private String password = null; - + @JsonProperty("phone") private String phone = null; - + @JsonProperty("userStatus") private Integer userStatus = null; - + public User id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public User username(String username) { this.username = username; return this; } - /** - * Get username - * @return username + + /** + * Get username + * @return username **/ @ApiModelProperty(value = "") public String getUsername() { return username; } - public void setUsername(String username) { this.username = username; } - + public User firstName(String firstName) { this.firstName = firstName; return this; } - /** - * Get firstName - * @return firstName + + /** + * Get firstName + * @return firstName **/ @ApiModelProperty(value = "") public String getFirstName() { return firstName; } - public void setFirstName(String firstName) { this.firstName = firstName; } - + public User lastName(String lastName) { this.lastName = lastName; return this; } - /** - * Get lastName - * @return lastName + + /** + * Get lastName + * @return lastName **/ @ApiModelProperty(value = "") public String getLastName() { return lastName; } - public void setLastName(String lastName) { this.lastName = lastName; } - + public User email(String email) { this.email = email; return this; } - /** - * Get email - * @return email + + /** + * Get email + * @return email **/ @ApiModelProperty(value = "") public String getEmail() { return email; } - public void setEmail(String email) { this.email = email; } - + public User password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - + public User phone(String phone) { this.phone = phone; return this; } - /** - * Get phone - * @return phone + + /** + * Get phone + * @return phone **/ @ApiModelProperty(value = "") public String getPhone() { return phone; } - public void setPhone(String phone) { this.phone = phone; } - + public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; } - /** - * User Status - * @return userStatus + + /** + * User Status + * @return userStatus **/ @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } - public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -217,8 +217,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -247,5 +246,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..f2b031f9485 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 @@ -15,14 +15,17 @@ import io.swagger.client.ApiException; import io.swagger.client.model.Client; + 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 AnotherFakeApi */ @@ -42,8 +45,10 @@ 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..9710cbe6764 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,23 +1,132 @@ +/* + * 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 io.swagger.client.model.OuterComposite; + 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 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 body = null; + + Boolean response = api.fakeOuterBooleanSerialize(body); + + // 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 + } + + /** + * 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 假端點 偽のエンドポイント 가짜 엔드 포인트 * @@ -28,19 +137,74 @@ public class FakeApiTest { */ @Test public void testEndpointParametersTest() throws ApiException { - BigDecimal number = null; - Double _double = null; - String string = 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 password = null; - // api.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); + + Object body = null; + + api.testEndpointParameters(body); + + // TODO: test validations + } + + /** + * To test enum parameters + * + * To test enum parameters + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testEnumParametersTest() throws ApiException { + + Object body = null; + + List enumHeaderStringArray = null; + + String enumHeaderString = null; + + List enumQueryStringArray = null; + + String enumQueryString = null; + + Integer enumQueryInteger = null; + + api.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); + + // TODO: test validations + } + + /** + * test inline additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineAdditionalPropertiesTest() throws ApiException { + + Map body = null; + + api.testInlineAdditionalProperties(body); + + // TODO: test validations + } + + /** + * test json serialization of form data + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testJsonFormDataTest() throws ApiException { + + Object body = null; + + api.testJsonFormData(body); // 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..dbda3faa692 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 @@ -15,14 +15,17 @@ import io.swagger.client.ApiException; import io.swagger.client.model.Client; + 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 FakeClassnameTags123Api */ @@ -42,8 +45,10 @@ 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/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..f02c13872eb 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,189 @@ -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.*; +/* + * 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. + */ -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.util.*; -import org.junit.*; -import static org.junit.Assert.*; - -public class PetApiTest { - private PetApi api; - private ObjectMapper mapper; +package io.swagger.client.api; - @Before - public void setup() { - api = new PetApi(); - // setup authentication - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) api.getApiClient().getAuthentication("api_key"); - apiKeyAuth.setApiKey("special-key"); - } +import io.swagger.client.ApiException; +import io.swagger.client.model.ModelApiResponse; +import io.swagger.client.model.Pet; - @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()); +import org.junit.Test; +import org.junit.Ignore; - ApiClient oldClient = api.getApiClient(); - ApiClient newClient = new ApiClient(); - newClient.setBasePath("http://example.com"); - newClient.setDebugging(true); +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; - // 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()); - } +/** + * 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 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); - - 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()); + public void deletePetTest() throws ApiException { + + Integer 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 testGetPetByIdInObject() throws Exception { - Pet pet = new Pet(); - pet.setId(TestUtils.nextId()); - pet.setName("pet " + pet.getId()); - - 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); + public void findPetsByStatusTest() throws ApiException { + + List status = null; + + List response = api.findPetsByStatus(status); - 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"); - - api.updatePet(pet); + public void findPetsByTagsTest() throws ApiException { + + List tags = null; + + List response = api.findPetsByTags(tags); - 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 } - + + /** + * Find pet by ID + * + * Returns a single pet + * + * @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 getPetByIdTest() throws ApiException { + + Integer petId = null; + + Pet response = api.getPetById(petId); - 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 } - + + /** + * Update an existing pet + * + * + * + * @throws ApiException + * if the Api call fails + */ @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); - + public void updatePetTest() throws ApiException { + + Pet pet = null; + 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); - } - - @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"); + // TODO: test validations } - + + /** + * Updates a pet in the store with form data + * + * + * + * @throws ApiException + * if the Api call fails + */ @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()); - } + public void updatePetWithFormTest() throws ApiException { + + Integer petId = null; + + Object body = null; + + api.updatePetWithForm(petId, body); + + // TODO: test validations } - + + /** + * uploads an image + * + * + * + * @throws ApiException + * if the Api call fails + */ @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())); + public void uploadFileTest() throws ApiException { + + Integer petId = null; + + Object body = null; + + ModelApiResponse response = api.uploadFile(petId, body); + + // TODO: test validations } - - @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..c6d9b89f0bd 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,108 @@ -package io.swagger.client.api; +/* + * 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. + */ + -import io.swagger.TestUtils; +package io.swagger.client.api; import io.swagger.client.ApiException; +import io.swagger.client.model.Order; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; +import org.junit.Test; +import org.junit.Ignore; -import java.lang.reflect.Field; -import java.util.Map; -import java.text.SimpleDateFormat; -import org.junit.*; -import org.threeten.bp.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; -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")); - } - - @Test - public void testGetInventory() throws Exception { - Map inventory = api.getInventory(); - assertTrue(inventory.keySet().size() > 0); - } - /* + 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 testGetInventoryInObject() throws Exception { - Object inventoryObj = api.getInventoryInObject(); - assertTrue(inventoryObj instanceof Map); - - Map inventoryMap = (Map) inventoryObj; - assertTrue(inventoryMap.keySet().size() > 0); + public void deleteOrderTest() throws ApiException { + + String orderId = null; + + api.deleteOrder(orderId); - Map.Entry firstEntry = (Map.Entry) inventoryMap.entrySet().iterator().next(); - assertTrue(firstEntry.getKey() instanceof String); - assertTrue(firstEntry.getValue() instanceof Integer); + // 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 testPlaceOrder() throws Exception { - Order order = createOrder(); - api.placeOrder(order); + public void getInventoryTest() throws ApiException { + + 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 + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testDeleteOrder() throws Exception { - Order order = createOrder(); - api.placeOrder(order); - - Order fetched = api.getOrderById(order.getId()); - assertEquals(fetched.getId(), order.getId()); + public void getOrderByIdTest() throws ApiException { + + Integer orderId = null; + + Order response = api.getOrderById(orderId); - api.deleteOrder(String.valueOf(order.getId())); - - try { - api.getOrderById(order.getId()); - // fail("expected an error"); - } catch (ApiException e) { - // ok - } + // 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); - 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..175f42fca9c 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,184 @@ +/* + * 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 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 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()); - - api.createUsersWithArrayInput(Arrays.asList(new User[]{user1, user2})); + public void createUsersWithArrayInputTest() throws ApiException { + + List body = null; + + api.createUsersWithArrayInput(body); - 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()); - - api.createUsersWithListInput(Arrays.asList(new User[]{user1, user2})); + public void createUsersWithListInputTest() throws ApiException { + + List body = null; + + api.createUsersWithListInput(body); - 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 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 logoutUser() throws Exception { - api.logoutUser(); + 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 { + + User user = null; + + String username = null; + + api.updateUser(user, username); + + // 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-java8/.swagger-codegen/VERSION b/samples/client/petstore/java/jersey2-java8/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/client/petstore/java/jersey2-java8/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/jersey2-java8/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8/README.md b/samples/client/petstore/java/jersey2-java8/README.md index 8ceb02c6e3b..6008bb43bf2 100644 --- a/samples/client/petstore/java/jersey2-java8/README.md +++ b/samples/client/petstore/java/jersey2-java8/README.md @@ -69,11 +69,16 @@ import java.util.*; public class AnotherFakeApiExample { public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + AnotherFakeApi apiInstance = new AnotherFakeApi(); - Client body = new Client(); // Client | client model + + Client 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"); @@ -127,14 +132,15 @@ Class | Method | HTTP request | Description - [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) @@ -155,8 +161,6 @@ Class | Method | HTTP request | Description - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) - - [Cat](docs/Cat.md) - - [Dog](docs/Dog.md) ## Documentation for Authorization @@ -168,24 +172,37 @@ 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 - **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 diff --git a/samples/client/petstore/java/jersey2-java8/build.gradle b/samples/client/petstore/java/jersey2-java8/build.gradle index 744c864310a..31f1472d454 100644 --- a/samples/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/client/petstore/java/jersey2-java8/build.gradle @@ -32,8 +32,11 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 + + } // Rename the aar correctly @@ -77,8 +80,11 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven' + sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 + + install { repositories.mavenInstaller { @@ -96,6 +102,7 @@ ext { swagger_annotations_version = "1.5.15" jackson_version = "2.8.9" jersey_version = "2.25.1" + junit_version = "4.12" } @@ -107,6 +114,12 @@ dependencies { compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" + + compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version", + + + + testCompile "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/jersey2-java8/build.sbt b/samples/client/petstore/java/jersey2-java8/build.sbt index 53198db6baa..7ff92396f94 100644 --- a/samples/client/petstore/java/jersey2-java8/build.sbt +++ b/samples/client/petstore/java/jersey2-java8/build.sbt @@ -16,7 +16,13 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-core" % "2.8.9" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.8.9" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.8.9" % "compile", + + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.8.9" % "compile", + + + + "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) diff --git a/samples/client/petstore/java/jersey2-java8/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/jersey2-java8/docs/AdditionalPropertiesClass.md index 0437c4dd8cc..b37862da7cf 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/java/jersey2-java8/docs/AdditionalPropertiesClass.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java8/docs/Animal.md b/samples/client/petstore/java/jersey2-java8/docs/Animal.md index b3f325c3524..346caaf63f4 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/Animal.md +++ b/samples/client/petstore/java/jersey2-java8/docs/Animal.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java8/docs/AnimalFarm.md b/samples/client/petstore/java/jersey2-java8/docs/AnimalFarm.md deleted file mode 100644 index c7c7f1ddcce..00000000000 --- a/samples/client/petstore/java/jersey2-java8/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ - -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - diff --git a/samples/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md index 7a04619aaba..fb5c988e6cc 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/AnotherFakeApi.md @@ -7,9 +7,11 @@ Method | HTTP request | Description [**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -22,10 +24,13 @@ To test special tags //import io.swagger.client.api.AnotherFakeApi; + AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +42,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -52,3 +58,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + + diff --git a/samples/client/petstore/java/jersey2-java8/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/jersey2-java8/docs/ArrayOfArrayOfNumberOnly.md index 77292549927..3671a5e9190 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/java/jersey2-java8/docs/ArrayOfArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java8/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/jersey2-java8/docs/ArrayOfNumberOnly.md index e8cc4cd36dc..30b9b6648f4 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/java/jersey2-java8/docs/ArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java8/docs/ArrayTest.md b/samples/client/petstore/java/jersey2-java8/docs/ArrayTest.md index 9feee16427f..4ab76343030 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/ArrayTest.md +++ b/samples/client/petstore/java/jersey2-java8/docs/ArrayTest.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java8/docs/Capitalization.md b/samples/client/petstore/java/jersey2-java8/docs/Capitalization.md index 0f3064c1996..9af7864f97e 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/Capitalization.md +++ b/samples/client/petstore/java/jersey2-java8/docs/Capitalization.md @@ -13,3 +13,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java8/docs/Cat.md b/samples/client/petstore/java/jersey2-java8/docs/Cat.md index 6e9f71ce7dd..5e408344021 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/Cat.md +++ b/samples/client/petstore/java/jersey2-java8/docs/Cat.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **declawed** | **Boolean** | | [optional] + diff --git a/samples/client/petstore/java/jersey2-java8/docs/Category.md b/samples/client/petstore/java/jersey2-java8/docs/Category.md index e2df0803278..deb5a3e2a52 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/Category.md +++ b/samples/client/petstore/java/jersey2-java8/docs/Category.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java8/docs/ClassModel.md b/samples/client/petstore/java/jersey2-java8/docs/ClassModel.md index 64f880c8786..49c281cc0ed 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/ClassModel.md +++ b/samples/client/petstore/java/jersey2-java8/docs/ClassModel.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java8/docs/Client.md b/samples/client/petstore/java/jersey2-java8/docs/Client.md index 5c490ea166c..52b2f72c79c 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/Client.md +++ b/samples/client/petstore/java/jersey2-java8/docs/Client.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java8/docs/Dog.md b/samples/client/petstore/java/jersey2-java8/docs/Dog.md index ac7cea323ff..00e6446e9f5 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/Dog.md +++ b/samples/client/petstore/java/jersey2-java8/docs/Dog.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **breed** | **String** | | [optional] + diff --git a/samples/client/petstore/java/jersey2-java8/docs/EnumArrays.md b/samples/client/petstore/java/jersey2-java8/docs/EnumArrays.md index 4dddc0bfd27..939a0e69587 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/EnumArrays.md +++ b/samples/client/petstore/java/jersey2-java8/docs/EnumArrays.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] + ## Enum: JustSymbolEnum Name | Value @@ -20,8 +21,6 @@ DOLLAR | "$" ## Enum: List<ArrayEnumEnum> Name | Value ---- | ----- -FISH | "fish" -CRAB | "crab" diff --git a/samples/client/petstore/java/jersey2-java8/docs/EnumTest.md b/samples/client/petstore/java/jersey2-java8/docs/EnumTest.md index 08fee344882..9722c621962 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/EnumTest.md +++ b/samples/client/petstore/java/jersey2-java8/docs/EnumTest.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] + ## Enum: EnumStringEnum Name | Value diff --git a/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md b/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md index 737ccc28293..6690b870e4e 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/FakeApi.md @@ -15,6 +15,8 @@ Method | HTTP request | Description [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data + + # **fakeOuterBooleanSerialize** > Boolean fakeOuterBooleanSerialize(body) @@ -30,8 +32,11 @@ Test serialization of outer boolean types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body + +Boolean body = ; // Boolean | Input boolean as post body + try { Boolean result = apiInstance.fakeOuterBooleanSerialize(body); System.out.println(result); @@ -47,6 +52,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + ### Return type **Boolean** @@ -57,12 +63,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outercomposite) @@ -75,10 +82,13 @@ Test serialization of object with outer number type //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body + +OuterComposite 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 +100,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outercomposite** | [**OuterComposite**](.md)| Input composite as post body | [optional] + ### Return type @@ -102,8 +113,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterNumberSerialize** @@ -120,8 +132,11 @@ Test serialization of outer number types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body + +BigDecimal body = ; // BigDecimal | Input number as post body + try { BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); System.out.println(result); @@ -137,6 +152,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + ### Return type [**BigDecimal**](BigDecimal.md) @@ -147,8 +163,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterStringSerialize** @@ -165,8 +182,11 @@ Test serialization of outer string types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String body = "body_example"; // String | Input string as post body + +String body = ; // String | Input string as post body + try { String result = apiInstance.fakeOuterStringSerialize(body); System.out.println(result); @@ -182,6 +202,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**String**](String.md)| Input string as post body | [optional] + ### Return type **String** @@ -192,12 +213,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -210,10 +232,13 @@ To test \"client\" model //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +250,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -240,9 +266,10 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + # **testEndpointParameters** -> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) +> testEndpointParameters(body) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -251,36 +278,17 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### 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.FakeApi; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure HTTP basic authorization: http_basic_test -HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); -http_basic_test.setUsername("YOUR USERNAME"); -http_basic_test.setPassword("YOUR PASSWORD"); 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 -Integer integer = 56; // Integer | None -Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None -Float _float = 3.4F; // Float | None -String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None -LocalDate date = new LocalDate(); // LocalDate | None -OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None -String password = "password_example"; // String | None -String paramCallback = "paramCallback_example"; // String | None + +Object body = ; // Object | + try { - apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + apiInstance.testEndpointParameters(body); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEndpointParameters"); e.printStackTrace(); @@ -291,20 +299,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **BigDecimal**| None | - **_double** | **Double**| None | - **patternWithoutDelimiter** | **String**| None | - **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] - **int64** | **Long**| None | [optional] - **_float** | **Float**| None | [optional] - **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] - **date** | **LocalDate**| None | [optional] - **dateTime** | **OffsetDateTime**| None | [optional] - **password** | **String**| None | [optional] - **paramCallback** | **String**| None | [optional] + **body** | [**Object**](Object.md)| | + ### Return type @@ -317,11 +313,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 + - **Accept**: Not defined + # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger) To test enum parameters @@ -334,17 +331,23 @@ To test enum parameters //import io.swagger.client.api.FakeApi; + 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) + +Object body = ; // Object | + List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) -String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + +String enumHeaderString = Arrays.asList("enumHeaderString_example"); // 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) + +String enumQueryString = Arrays.asList("enumQueryString_example"); // String | Query parameter enum test (string) + +Integer enumQueryInteger = Arrays.asList(56); // Integer | Query parameter enum test (double) + try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -355,14 +358,13 @@ 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] + **body** | [**Object**](Object.md)| | [optional] + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: ] + **enumHeaderString** | [**String**](.md)| Header parameter enum test (string) | [optional] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: ] + **enumQueryString** | [**String**](.md)| Query parameter enum test (string) | [optional] + **enumQueryInteger** | [**Integer**](.md)| Query parameter enum test (double) | [optional] + ### Return type @@ -375,16 +377,15 @@ No authorization required ### HTTP request headers - **Content-Type**: */* - - **Accept**: */* + - **Accept**: Not defined + # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(body) test inline additionalProperties - - ### Example ```java // Import classes: @@ -392,10 +393,13 @@ test inline additionalProperties //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body + +Map body = ; // Map | request body + try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(body); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); e.printStackTrace(); @@ -406,7 +410,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **body** | [**Map<String, String>**](Map.md)| request body | + ### Return type @@ -421,14 +426,13 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined + # **testJsonFormData** -> testJsonFormData(param, param2) +> testJsonFormData(body) test json serialization of form data - - ### Example ```java // Import classes: @@ -436,11 +440,13 @@ test json serialization of form data //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String param = "param_example"; // String | field1 -String param2 = "param2_example"; // String | field2 + +Object body = ; // Object | + try { - apiInstance.testJsonFormData(param, param2); + apiInstance.testJsonFormData(body); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testJsonFormData"); e.printStackTrace(); @@ -451,8 +457,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **String**| field1 | - **param2** | **String**| field2 | + **body** | [**Object**](Object.md)| | + ### Return type @@ -467,3 +473,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined + + diff --git a/samples/client/petstore/java/jersey2-java8/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/jersey2-java8/docs/FakeClassnameTags123Api.md index bc728bfce5b..2bcbbb7908f 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/jersey2-java8/docs/FakeClassnameTags123Api.md @@ -7,33 +7,28 @@ Method | HTTP request | Description [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case ### 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.FakeClassnameTags123Api; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure API key authorization: api_key_query -ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); -api_key_query.setApiKey("YOUR API KEY"); -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model + +Client 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 +40,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -60,3 +56,5 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + + 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/FormatTest.md b/samples/client/petstore/java/jersey2-java8/docs/FormatTest.md index c7a3acb3cb7..bc11b93cb26 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/FormatTest.md +++ b/samples/client/petstore/java/jersey2-java8/docs/FormatTest.md @@ -11,8 +11,8 @@ Name | Type | Description | Notes **_float** | **Float** | | [optional] **_double** | **Double** | | [optional] **string** | **String** | | [optional] -**_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**_byte** | **String** | | +**binary** | **String** | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] @@ -20,3 +20,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java8/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/jersey2-java8/docs/HasOnlyReadOnly.md index c1d0aac5672..5564ddcf28a 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/java/jersey2-java8/docs/HasOnlyReadOnly.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java8/docs/MapTest.md b/samples/client/petstore/java/jersey2-java8/docs/MapTest.md index 714a97a40d9..74a6fe8ae70 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/MapTest.md +++ b/samples/client/petstore/java/jersey2-java8/docs/MapTest.md @@ -8,12 +8,11 @@ Name | Type | Description | Notes **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] + ## Enum: Map<String, InnerEnum> Name | Value ---- | ----- -UPPER | "UPPER" -LOWER | "lower" diff --git a/samples/client/petstore/java/jersey2-java8/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/jersey2-java8/docs/MixedPropertiesAndAdditionalPropertiesClass.md index b12e2cd70e6..4507481b5a9 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/jersey2-java8/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java8/docs/Model200Response.md b/samples/client/petstore/java/jersey2-java8/docs/Model200Response.md index 5b3a9a0e46d..8d2cc50bb83 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/Model200Response.md +++ b/samples/client/petstore/java/jersey2-java8/docs/Model200Response.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java8/docs/ModelApiResponse.md b/samples/client/petstore/java/jersey2-java8/docs/ModelApiResponse.md index 3eec8686cc9..06052b202f1 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/ModelApiResponse.md +++ b/samples/client/petstore/java/jersey2-java8/docs/ModelApiResponse.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java8/docs/ModelReturn.md b/samples/client/petstore/java/jersey2-java8/docs/ModelReturn.md index a679b04953e..a7845ba254b 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/ModelReturn.md +++ b/samples/client/petstore/java/jersey2-java8/docs/ModelReturn.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java8/docs/Name.md b/samples/client/petstore/java/jersey2-java8/docs/Name.md index ce2fb4dee50..a8d6fec9714 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/Name.md +++ b/samples/client/petstore/java/jersey2-java8/docs/Name.md @@ -11,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java8/docs/NumberOnly.md b/samples/client/petstore/java/jersey2-java8/docs/NumberOnly.md index a3feac7fadc..adfb36a95bb 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/NumberOnly.md +++ b/samples/client/petstore/java/jersey2-java8/docs/NumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java8/docs/Order.md b/samples/client/petstore/java/jersey2-java8/docs/Order.md index 268c617d1ff..7e4beff6df1 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/Order.md +++ b/samples/client/petstore/java/jersey2-java8/docs/Order.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/jersey2-java8/docs/OuterComposite.md b/samples/client/petstore/java/jersey2-java8/docs/OuterComposite.md index 3f5a633c998..1963c7a0f73 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/OuterComposite.md +++ b/samples/client/petstore/java/jersey2-java8/docs/OuterComposite.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java8/docs/Pet.md b/samples/client/petstore/java/jersey2-java8/docs/Pet.md index 5b63109ef92..1492195a58d 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/Pet.md +++ b/samples/client/petstore/java/jersey2-java8/docs/Pet.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/jersey2-java8/docs/PetApi.md b/samples/client/petstore/java/jersey2-java8/docs/PetApi.md index b5fa395947d..4758743434a 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/PetApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/PetApi.md @@ -14,33 +14,28 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image + + # **addPet** -> addPet(body) +> addPet(pet) 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 + +Pet 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 +46,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -64,7 +60,8 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **deletePet** @@ -72,26 +69,20 @@ null (empty response body) 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 | + +Integer petId = Arrays.asList(56); // Integer | Pet id to delete + +String apiKey = Arrays.asList("apiKey_example"); // String | + try { apiInstance.deletePet(petId, apiKey); } catch (ApiException e) { @@ -104,8 +95,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | - **apiKey** | **String**| | [optional] + **petId** | [**Integer**](.md)| Pet id to delete | + **apiKey** | [**String**](.md)| | [optional] + ### Return type @@ -118,7 +110,8 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **findPetsByStatus** @@ -131,20 +124,15 @@ 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); @@ -158,7 +146,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: ] + ### Return type @@ -173,6 +162,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **findPetsByTags** > List<Pet> findPetsByTags(tags) @@ -184,20 +174,15 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### 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); @@ -213,6 +198,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | + ### Return type [**List<Pet>**](Pet.md) @@ -226,6 +212,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **getPetById** > Pet getPetById(petId) @@ -237,22 +224,15 @@ 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to return + try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -266,7 +246,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to return | + **petId** | [**Integer**](.md)| ID of pet to return | + ### Return type @@ -281,33 +262,27 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **updatePet** -> updatePet(body) +> updatePet(pet) 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 + +Pet 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 +293,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -331,37 +307,31 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updatePetWithForm** -> updatePetWithForm(petId, name, status) +> updatePetWithForm(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet that needs to be updated + +Object body = ; // Object | + try { - apiInstance.updatePetWithForm(petId, name, status); + apiInstance.updatePetWithForm(petId, body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePetWithForm"); e.printStackTrace(); @@ -372,9 +342,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet that needs to be updated | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -387,37 +357,31 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **uploadFile** -> ModelApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to update + +Object body = ; // Object | + try { - ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); + ModelApiResponse result = apiInstance.uploadFile(petId, body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFile"); @@ -429,9 +393,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet to update | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -446,3 +410,5 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json + + diff --git a/samples/client/petstore/java/jersey2-java8/docs/ReadOnlyFirst.md b/samples/client/petstore/java/jersey2-java8/docs/ReadOnlyFirst.md index 426b7cde95a..57655e5b49e 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/java/jersey2-java8/docs/ReadOnlyFirst.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java8/docs/SpecialModelName.md b/samples/client/petstore/java/jersey2-java8/docs/SpecialModelName.md index c2c6117c552..f4259d2a73c 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/SpecialModelName.md +++ b/samples/client/petstore/java/jersey2-java8/docs/SpecialModelName.md @@ -4,7 +4,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] +**$specialPropertyName** | **Long** | | [optional] + diff --git a/samples/client/petstore/java/jersey2-java8/docs/StoreApi.md b/samples/client/petstore/java/jersey2-java8/docs/StoreApi.md index 7aed6450e6a..a4678ee745c 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/StoreApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/StoreApi.md @@ -10,6 +10,8 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + # **deleteOrder** > deleteOrder(orderId) @@ -25,8 +27,11 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + +String orderId = Arrays.asList("orderId_example"); // String | ID of the order that needs to be deleted + try { apiInstance.deleteOrder(orderId); } catch (ApiException e) { @@ -39,7 +44,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | + **orderId** | [**String**](.md)| ID of the order that needs to be deleted | + ### Return type @@ -52,7 +58,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getInventory** @@ -65,21 +72,13 @@ 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); @@ -92,6 +91,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type **Map<String, Integer>** @@ -105,6 +105,7 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json + # **getOrderById** > Order getOrderById(orderId) @@ -120,8 +121,11 @@ For valid response try integer IDs with value <= 5 or > 10. Other val //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched + +Integer orderId = Arrays.asList(56); // Integer | ID of pet that needs to be fetched + try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +139,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | [**Integer**](.md)| ID of pet that needs to be fetched | + ### Return type @@ -150,14 +155,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -165,10 +169,13 @@ Place an order for a pet //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet + +Order 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 +187,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](.md)| order placed for purchasing the pet | + ### Return type @@ -192,6 +200,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: */* - **Accept**: application/xml, application/json + + diff --git a/samples/client/petstore/java/jersey2-java8/docs/Tag.md b/samples/client/petstore/java/jersey2-java8/docs/Tag.md index de6814b55d5..7a97d4c6812 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/Tag.md +++ b/samples/client/petstore/java/jersey2-java8/docs/Tag.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java8/docs/User.md b/samples/client/petstore/java/jersey2-java8/docs/User.md index 8b6753dd284..cf7f9ce1312 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/User.md +++ b/samples/client/petstore/java/jersey2-java8/docs/User.md @@ -15,3 +15,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java8/docs/UserApi.md b/samples/client/petstore/java/jersey2-java8/docs/UserApi.md index 2e6987951c8..e421376ce79 100644 --- a/samples/client/petstore/java/jersey2-java8/docs/UserApi.md +++ b/samples/client/petstore/java/jersey2-java8/docs/UserApi.md @@ -14,9 +14,11 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + # **createUser** -> createUser(body) +> createUser(user) Create user @@ -29,10 +31,13 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object + +User 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 +48,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](.md)| Created user object | + ### Return type @@ -55,8 +61,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithArrayInput** @@ -64,8 +71,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -73,8 +78,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -89,6 +97,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type null (empty response body) @@ -99,8 +108,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithListInput** @@ -108,8 +118,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -117,8 +125,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { @@ -133,6 +144,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type null (empty response body) @@ -143,8 +155,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **deleteUser** @@ -161,8 +174,11 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be deleted + +String username = Arrays.asList("username_example"); // String | The name that needs to be deleted + try { apiInstance.deleteUser(username); } catch (ApiException e) { @@ -175,7 +191,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | + **username** | [**String**](.md)| The name that needs to be deleted | + ### Return type @@ -188,7 +205,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getUserByName** @@ -196,8 +214,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -205,8 +221,11 @@ Get user by user name //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. + +String username = Arrays.asList("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 +239,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + **username** | [**String**](.md)| The name that needs to be fetched. Use user1 for testing. | + ### Return type @@ -235,14 +255,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **loginUser** > String loginUser(username, password) Logs user into the system - - ### Example ```java // Import classes: @@ -250,9 +269,13 @@ Logs user into the system //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 + +String username = Arrays.asList("username_example"); // String | The user name for login + +String password = Arrays.asList("password_example"); // String | The password for login in clear text + try { String result = apiInstance.loginUser(username, password); System.out.println(result); @@ -266,8 +289,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | + **username** | [**String**](.md)| The user name for login | + **password** | [**String**](.md)| The password for login in clear text | + ### Return type @@ -282,14 +306,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **logoutUser** > logoutUser() Logs out current logged in user session - - ### Example ```java // Import classes: @@ -297,7 +320,9 @@ Logs out current logged in user session //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); + try { apiInstance.logoutUser(); } catch (ApiException e) { @@ -309,6 +334,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type null (empty response body) @@ -320,11 +346,12 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updateUser** -> updateUser(username, body) +> updateUser(user, username) Updated user @@ -337,11 +364,15 @@ This can only be done by the logged in user. //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 + +User user = ; // User | Updated user object + +String username = Arrays.asList("username_example"); // String | name that need to be deleted + try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(user, username); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -352,8 +383,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](.md)| Updated user object | + **username** | [**String**](.md)| name that need to be deleted | + ### Return type @@ -365,6 +397,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + + diff --git a/samples/client/petstore/java/jersey2-java8/git_push.sh b/samples/client/petstore/java/jersey2-java8/git_push.sh index ae01b182ae9..ed374619b13 100644 --- a/samples/client/petstore/java/jersey2-java8/git_push.sh +++ b/samples/client/petstore/java/jersey2-java8/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 credential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential 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/jersey2-java8/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.jar index 2c6137b8789..e69de29bb2d 100644 Binary files a/samples/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/jersey2-java8/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index 846832f4461..d278f447b00 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -1,260 +1,253 @@ - 4.0.0 - io.swagger - swagger-petstore-jersey2 - jar - swagger-petstore-jersey2 - 1.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-petstore-jersey2 + jar + swagger-petstore-jersey2 + 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 - 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 + - - - 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 - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - 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-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.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + jar + test-jar + + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - - - 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 - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + + + 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 - - - - - - - - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + - - - io.swagger - swagger-annotations - ${swagger-core-version} - + + + io.swagger + swagger-annotations + ${swagger-core-version} + - - - org.glassfish.jersey.core - jersey-client - ${jersey-version} - - - org.glassfish.jersey.media - jersey-media-multipart - ${jersey-version} - - - org.glassfish.jersey.media - jersey-media-json-jackson - ${jersey-version} - + + + org.glassfish.jersey.core + jersey-client + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-multipart + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-json-jackson + ${jersey-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} - - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.5.15 - 2.25.1 - 2.7.5 - 1.0.0 - 4.12 - + + + 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} + + + + + + + + + junit + junit + ${junit-version} + test + + + + 1.5.15 + + 2.25.1 + + + 2.7.5 + 1.0.0 + 4.12 + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/ApiClient.java index b7341098733..cf1a2f6d5de 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/ApiClient.java @@ -15,6 +15,7 @@ import org.glassfish.jersey.client.ClientProperties; import org.glassfish.jersey.client.HttpUrlConnectorProvider; import org.glassfish.jersey.jackson.JacksonFeature; +import org.glassfish.jersey.logging.LoggingFeature; import org.glassfish.jersey.media.multipart.FormDataBodyPart; import org.glassfish.jersey.media.multipart.FormDataContentDisposition; import org.glassfish.jersey.media.multipart.MultiPart; @@ -23,9 +24,11 @@ import java.io.IOException; import java.io.InputStream; + import java.nio.file.Files; import java.nio.file.StandardCopyOption; -import org.glassfish.jersey.logging.LoggingFeature; + + import java.util.Collection; import java.util.Collections; import java.util.Map; @@ -56,7 +59,6 @@ public class ApiClient { protected String basePath = "http://petstore.swagger.io:80/v2"; protected boolean debugging = false; protected int connectionTimeout = 0; - private int readTimeout = 0; protected Client httpClient; protected JSON json; @@ -303,27 +305,6 @@ public ApiClient setConnectTimeout(int connectionTimeout) { return this; } - /** - * read timeout (in milliseconds). - * @return Read timeout - */ - public int getReadTimeout() { - return readTimeout; - } - - /** - * Set the read timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link Integer#MAX_VALUE}. - * @param readTimeout Read timeout in milliseconds - * @return API client - */ - public ApiClient setReadTimeout(int readTimeout) { - this.readTimeout = readTimeout; - httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout); - return this; - } - /** * Get the date format used to parse/format date parameters. * @return Date format @@ -586,6 +567,8 @@ public T deserialize(Response response, GenericType returnType) throws Ap List contentTypes = response.getHeaders().get("Content-Type"); if (contentTypes != null && !contentTypes.isEmpty()) contentType = String.valueOf(contentTypes.get(0)); + if (contentType == null) + throw new ApiException(500, "missing Content-Type in response"); return response.readEntity(returnType); } @@ -599,7 +582,10 @@ public T deserialize(Response response, GenericType returnType) throws Ap public File downloadFileFromResponse(Response response) throws ApiException { try { File file = prepareDownloadFile(response); + Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING); + + return file; } catch (IOException e) { throw new ApiException(e); diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/JSON.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/JSON.java index fa10243e548..9f856f89ce7 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/JSON.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/JSON.java @@ -1,9 +1,14 @@ package io.swagger.client; + import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; + import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; + + + import java.text.DateFormat; import javax.ws.rs.ext.ContextResolver; @@ -21,7 +26,11 @@ public JSON() { mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.setDateFormat(new RFC3339DateFormat()); + mapper.registerModule(new JavaTimeModule()); + + + } /** diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/AnotherFakeApi.java index 494f81b84d2..41c44e53e34 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -9,12 +9,16 @@ import io.swagger.client.model.Client; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class AnotherFakeApi { private ApiClient apiClient; @@ -34,19 +38,27 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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 @@ -57,9 +69,12 @@ public Client testSpecialTags(Client body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/json" }; @@ -72,7 +87,11 @@ public Client testSpecialTags(Client body) throws ApiException { String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + } + 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 250114eb256..a10cd5ef785 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 @@ -9,16 +9,18 @@ import java.math.BigDecimal; import io.swagger.client.model.Client; -import java.time.LocalDate; -import java.time.OffsetDateTime; import io.swagger.client.model.OuterComposite; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class FakeApi { private ApiClient apiClient; @@ -38,13 +40,21 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * * Test serialization of outer boolean types + * @param body 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; @@ -56,33 +66,46 @@ public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * * 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"; @@ -92,31 +115,44 @@ public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Ap Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * * Test serialization of outer number types + * @param body Input number as post body (optional) + + * @return BigDecimal + * @throws ApiException if fails to make API call + + */ + public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException { Object localVarPostBody = body; @@ -128,31 +164,44 @@ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * * Test serialization of outer string types + * @param body Input string as post body (optional) + + * @return String + * @throws ApiException if fails to make API call + + */ + public String fakeOuterStringSerialize(String body) throws ApiException { Object localVarPostBody = body; @@ -164,37 +213,50 @@ public String fakeOuterStringSerialize(String body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * 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 @@ -205,9 +267,12 @@ public Client testClientModel(Client body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/json" }; @@ -220,49 +285,30 @@ public Client testClientModel(Client body) throws ApiException { String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) + + * @param body (required) + + * @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 { - Object localVarPostBody = null; - - // verify the required parameter 'number' is set - if (number == null) { - throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters"); - } - - // verify the required parameter '_double' is set - if (_double == null) { - throw new ApiException(400, "Missing the required parameter '_double' when calling testEndpointParameters"); - } - - // verify the required parameter 'patternWithoutDelimiter' is set - if (patternWithoutDelimiter == null) { - throw new ApiException(400, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); - } + + public void testEndpointParameters(Object body) throws ApiException { + Object localVarPostBody = body; - // verify the required parameter '_byte' is set - if (_byte == null) { - throw new ApiException(400, "Missing the required parameter '_byte' when calling testEndpointParameters"); + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testEndpointParameters"); } // create path and map variables @@ -273,39 +319,14 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + - if (integer != null) - localVarFormParams.put("integer", integer); -if (int32 != null) - localVarFormParams.put("int32", int32); -if (int64 != null) - localVarFormParams.put("int64", int64); -if (number != null) - localVarFormParams.put("number", number); -if (_float != null) - localVarFormParams.put("float", _float); -if (_double != null) - localVarFormParams.put("double", _double); -if (string != null) - localVarFormParams.put("string", string); -if (patternWithoutDelimiter != null) - localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter); -if (_byte != null) - localVarFormParams.put("byte", _byte); -if (binary != null) - localVarFormParams.put("binary", binary); -if (date != null) - localVarFormParams.put("date", date); -if (dateTime != null) - localVarFormParams.put("dateTime", dateTime); -if (password != null) - localVarFormParams.put("password", password); -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); @@ -316,24 +337,35 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat String[] localVarAuthNames = new String[] { "http_basic_test" }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, 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 body (optional) + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + + * @param enumHeaderString Header parameter enum test (string) (optional) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + + * @param enumQueryString Query parameter enum test (string) (optional) + * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (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 { - Object localVarPostBody = null; + + public void testEnumParameters(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger) throws ApiException { + Object localVarPostBody = body; // create path and map variables String localVarPath = "/fake"; @@ -343,24 +375,24 @@ public void testEnumParameters(List enumFormStringArray, String enumForm Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray)); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string_array", enumQueryStringArray)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger)); + if (enumHeaderStringArray != null) localVarHeaderParams.put("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); -if (enumHeaderString != null) + if (enumHeaderString != null) localVarHeaderParams.put("enum_header_string", apiClient.parameterToString(enumHeaderString)); + - 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); + final String[] localVarAccepts = { - "*/*" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -371,21 +403,29 @@ public void testEnumParameters(List enumFormStringArray, String enumForm String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * test inline additionalProperties * - * @param param request body (required) + + * @param body request body (required) + + * @throws ApiException if fails to make API call + + */ - public void testInlineAdditionalProperties(Object param) throws ApiException { - Object localVarPostBody = param; + + public void testInlineAdditionalProperties(Map body) throws ApiException { + Object localVarPostBody = body; - // 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 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testInlineAdditionalProperties"); } // create path and map variables @@ -396,9 +436,12 @@ public void testInlineAdditionalProperties(Object param) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { }; @@ -411,27 +454,29 @@ public void testInlineAdditionalProperties(Object param) throws ApiException { String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * test json serialization of form data * - * @param param field1 (required) - * @param param2 field2 (required) + + * @param body (required) + + * @throws ApiException if fails to make API call + + */ - public void testJsonFormData(String param, String param2) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'param' is set - if (param == null) { - throw new ApiException(400, "Missing the required parameter 'param' when calling testJsonFormData"); - } + + public void testJsonFormData(Object body) throws ApiException { + Object localVarPostBody = body; - // verify the required parameter 'param2' is set - if (param2 == null) { - throw new ApiException(400, "Missing the required parameter 'param2' when calling testJsonFormData"); + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testJsonFormData"); } // create path and map variables @@ -442,12 +487,11 @@ public void testJsonFormData(String param, String param2) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + - if (param != null) - localVarFormParams.put("param", param); -if (param2 != null) - localVarFormParams.put("param2", param2); final String[] localVarAccepts = { @@ -461,7 +505,10 @@ public void testJsonFormData(String param, String param2) throws ApiException { String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + } + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index 41b78ca6524..9a1e8f9acb9 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -9,12 +9,16 @@ import io.swagger.client.model.Client; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class FakeClassnameTags123Api { private ApiClient apiClient; @@ -34,19 +38,27 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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 @@ -57,9 +69,12 @@ public Client testClassname(Client body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/json" }; @@ -72,7 +87,11 @@ public Client testClassname(Client body) throws ApiException { String[] localVarAuthNames = new String[] { "api_key_query" }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + } + 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 6af9763779c..8621d0703ac 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 @@ -7,16 +7,19 @@ import javax.ws.rs.core.GenericType; -import java.io.File; import io.swagger.client.model.ModelApiResponse; import io.swagger.client.model.Pet; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class PetApi { private ApiClient apiClient; @@ -36,18 +39,25 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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 @@ -58,11 +68,14 @@ public void addPet(Pet body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -73,17 +86,26 @@ public void addPet(Pet body) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Deletes a pet * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + + * @throws ApiException if fails to make API call + + */ - public void deletePet(Long petId, String apiKey) throws ApiException { + + public void deletePet(Integer petId, String apiKey) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'petId' is set @@ -100,13 +122,16 @@ public void deletePet(Long petId, String apiKey) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (apiKey != null) localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey)); + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -117,16 +142,25 @@ public void deletePet(Long petId, String apiKey) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; - + apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + + * @return List<Pet> + * @throws ApiException if fails to make API call + + */ + public List findPetsByStatus(List status) throws ApiException { Object localVarPostBody = null; @@ -143,10 +177,14 @@ public List findPetsByStatus(List status) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status)); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status)); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -159,18 +197,28 @@ public List findPetsByStatus(List status) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; + GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + + * @return List<Pet> + * @throws ApiException if fails to make API call * @deprecated + + */ @Deprecated + public List findPetsByTags(List tags) throws ApiException { Object localVarPostBody = null; @@ -187,10 +235,14 @@ public List findPetsByTags(List tags) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags)); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "tags", tags)); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -203,17 +255,27 @@ public List findPetsByTags(List tags) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; + GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * Find pet by ID * Returns a single pet + * @param petId ID of pet to return (required) + + * @return Pet + * @throws ApiException if fails to make API call + + */ - public Pet getPetById(Long petId) throws ApiException { + + public Pet getPetById(Integer petId) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'petId' is set @@ -230,9 +292,12 @@ public Pet getPetById(Long petId) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -245,21 +310,30 @@ public Pet getPetById(Long petId) throws ApiException { String[] localVarAuthNames = new String[] { "api_key" }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * 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 @@ -270,11 +344,14 @@ public void updatePet(Pet body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -285,19 +362,27 @@ public void updatePet(Pet body) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; - + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Updates a pet in the store with form data * + * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) + + * @param body (optional) + + * @throws ApiException if fails to make API call + + */ - public void updatePetWithForm(Long petId, String name, String status) throws ApiException { - Object localVarPostBody = null; + + public void updatePetWithForm(Integer petId, Object body) throws ApiException { + Object localVarPostBody = body; // verify the required parameter 'petId' is set if (petId == null) { @@ -313,15 +398,14 @@ public void updatePetWithForm(Long petId, String name, String status) throws Api Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + - if (name != null) - localVarFormParams.put("name", name); -if (status != null) - localVarFormParams.put("status", status); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -332,20 +416,29 @@ public void updatePetWithForm(Long petId, String name, String status) throws Api String[] localVarAuthNames = new String[] { "petstore_auth" }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * uploads an image * + * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) + + * @param body (optional) + + * @return ModelApiResponse + * @throws ApiException if fails to make API call + + */ - public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException { - Object localVarPostBody = null; + + public ModelApiResponse uploadFile(Integer petId, Object body) throws ApiException { + Object localVarPostBody = body; // verify the required parameter 'petId' is set if (petId == null) { @@ -361,12 +454,11 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + - if (additionalMetadata != null) - localVarFormParams.put("additionalMetadata", additionalMetadata); -if (file != null) - localVarFormParams.put("file", file); final String[] localVarAccepts = { "application/json" @@ -380,7 +472,11 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f String[] localVarAuthNames = new String[] { "petstore_auth" }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + } + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/StoreApi.java index 22be0ebb027..32c0564e1c5 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/StoreApi.java @@ -9,12 +9,16 @@ import io.swagger.client.model.Order; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class StoreApi { private ApiClient apiClient; @@ -34,12 +38,19 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + + * @throws ApiException if fails to make API call + + */ + public void deleteOrder(String orderId) throws ApiException { Object localVarPostBody = null; @@ -57,11 +68,14 @@ public void deleteOrder(String orderId) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -72,15 +86,23 @@ public void deleteOrder(String orderId) throws ApiException { String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Returns pet inventories by status * Returns a map of status codes to quantities + + * @return Map<String, Integer> + * @throws ApiException if fails to make API call + + */ + public Map getInventory() throws ApiException { Object localVarPostBody = null; @@ -92,9 +114,12 @@ public Map getInventory() throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/json" }; @@ -107,17 +132,27 @@ public Map getInventory() throws ApiException { String[] localVarAuthNames = new String[] { "api_key" }; + GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + + * @return Order + * @throws ApiException if fails to make API call + + */ - public Order getOrderById(Long orderId) throws ApiException { + + public Order getOrderById(Integer orderId) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'orderId' is set @@ -134,9 +169,12 @@ public Order getOrderById(Long orderId) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -149,22 +187,32 @@ public Order getOrderById(Long orderId) throws ApiException { String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * 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 @@ -175,22 +223,29 @@ public Order placeOrder(Order body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + } + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/UserApi.java index a7dced63d85..8b966c3c71d 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/api/UserApi.java @@ -9,12 +9,16 @@ import io.swagger.client.model.User; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class UserApi { private ApiClient apiClient; @@ -34,18 +38,25 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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 @@ -56,30 +67,41 @@ public void createUser(User body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Creates list of users with given input array * + * @param body List of user object (required) + + * @throws ApiException if fails to make API call + + */ + public void createUsersWithArrayInput(List body) throws ApiException { Object localVarPostBody = body; @@ -96,30 +118,41 @@ public void createUsersWithArrayInput(List body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Creates list of users with given input array * + * @param body List of user object (required) + + * @throws ApiException if fails to make API call + + */ + public void createUsersWithListInput(List body) throws ApiException { Object localVarPostBody = body; @@ -136,30 +169,41 @@ public void createUsersWithListInput(List body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Delete user * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + + * @throws ApiException if fails to make API call + + */ + public void deleteUser(String username) throws ApiException { Object localVarPostBody = null; @@ -177,11 +221,14 @@ public void deleteUser(String username) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -192,16 +239,25 @@ public void deleteUser(String username) throws ApiException { String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Get user by user name * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + + * @return User + * @throws ApiException if fails to make API call + + */ + public User getUserByName(String username) throws ApiException { Object localVarPostBody = null; @@ -219,9 +275,12 @@ public User getUserByName(String username) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -234,17 +293,28 @@ public User getUserByName(String username) throws ApiException { String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * Logs user into the system * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + + * @return String + * @throws ApiException if fails to make API call + + */ + public String loginUser(String username, String password) throws ApiException { Object localVarPostBody = null; @@ -266,11 +336,16 @@ public String loginUser(String username, String password) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "password", password)); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -283,14 +358,22 @@ public String loginUser(String username, String password) throws ApiException { String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * Logs out current logged in user session * + + * @throws ApiException if fails to make API call + + */ + public void logoutUser() throws ApiException { Object localVarPostBody = null; @@ -302,11 +385,14 @@ public void logoutUser() throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -317,29 +403,38 @@ public void logoutUser() throws ApiException { String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Updated user * This can only be done by the logged in user. + + * @param user Updated user object (required) + * @param username name that need to be deleted (required) - * @param body 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(User user, String username) throws ApiException { + Object localVarPostBody = user; + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser"); + } // 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"); - } - // create path and map variables String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); @@ -349,22 +444,28 @@ public void updateUser(String username, User body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + } + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/auth/HttpBasicAuth.java index 0b2a5b49214..0878c9f168b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/auth/HttpBasicAuth.java @@ -15,14 +15,18 @@ import io.swagger.client.Pair; + + import java.util.Base64; import java.nio.charset.StandardCharsets; + import java.util.Map; import java.util.List; + public class HttpBasicAuth implements Authentication { private String username; private String password; @@ -49,6 +53,9 @@ public void applyToParams(List queryParams, Map headerPara return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + + headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + } } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 0c24badae38..946f6319432 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -28,65 +28,65 @@ */ public class AdditionalPropertiesClass { + @JsonProperty("map_property") private Map mapProperty = null; - + @JsonProperty("map_of_map_property") private Map> mapOfMapProperty = null; - + public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; return this; } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { this.mapProperty = new HashMap<>(); } + this.mapProperty.put(key, mapPropertyItem); return this; } - - /** - * Get mapProperty - * @return mapProperty + /** + * Get mapProperty + * @return mapProperty **/ @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } - public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } - + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; return this; } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { this.mapOfMapProperty = new HashMap<>(); } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } - - /** - * Get mapOfMapProperty - * @return mapOfMapProperty + /** + * Get mapOfMapProperty + * @return mapOfMapProperty **/ @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -104,8 +104,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapProperty, mapOfMapProperty); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -128,5 +127,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Animal.java index 590f36c0ae0..ddd1f98533f 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Animal.java @@ -25,56 +25,60 @@ /** * Animal */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true ) + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Discriminator{propertyName='className', mapping=null}", visible = true ) @JsonSubTypes({ + @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + }) public class Animal { + @JsonProperty("className") private String className = null; - + @JsonProperty("color") private String color = "red"; - + public Animal className(String className) { this.className = className; return this; } - /** - * Get className - * @return className + + /** + * Get className + * @return className **/ @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } - public void setClassName(String className) { this.className = className; } - + public Animal color(String color) { this.color = color; return this; } - /** - * Get color - * @return color + + /** + * Get color + * @return color **/ @ApiModelProperty(value = "") public String getColor() { return color; } - public void setColor(String color) { this.color = color; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -92,8 +96,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(className, color); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -116,5 +119,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AnimalFarm.java deleted file mode 100644 index 0b1d6a74cc6..00000000000 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/AnimalFarm.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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 io.swagger.client.model.Animal; -import java.util.ArrayList; -import java.util.List; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 5997b31cbd4..3e850a94aa5 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -28,36 +28,37 @@ */ public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") private List> arrayArrayNumber = null; - + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; return this; } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { this.arrayArrayNumber = new ArrayList<>(); } + this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber **/ @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } - public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,8 +75,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayArrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -97,5 +97,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 2bc17f88eb3..8882f76ab46 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -28,36 +28,37 @@ */ public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") private List arrayNumber = null; - + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; return this; } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { this.arrayNumber = new ArrayList<>(); } + this.arrayNumber.add(arrayNumberItem); return this; } - - /** - * Get arrayNumber - * @return arrayNumber + + /** + * Get arrayNumber + * @return arrayNumber **/ @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } - public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,8 +75,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -97,5 +97,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayTest.java index 6804a14e313..8b4867aebff 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ArrayTest.java @@ -28,94 +28,97 @@ */ public class ArrayTest { + @JsonProperty("array_of_string") private List arrayOfString = null; - + @JsonProperty("array_array_of_integer") private List> arrayArrayOfInteger = null; - + @JsonProperty("array_array_of_model") private List> arrayArrayOfModel = null; - + public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; return this; } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { this.arrayOfString = new ArrayList<>(); } + this.arrayOfString.add(arrayOfStringItem); return this; } - - /** - * Get arrayOfString - * @return arrayOfString + + /** + * Get arrayOfString + * @return arrayOfString **/ @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } - public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } - + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { this.arrayArrayOfInteger = new ArrayList<>(); } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger **/ @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } - + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { this.arrayArrayOfModel = new ArrayList<>(); } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel **/ @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } - public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -134,8 +137,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -159,5 +161,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Capitalization.java index a72b0a72f46..f534657b4ca 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Capitalization.java @@ -25,133 +25,133 @@ */ public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel = null; - + @JsonProperty("CapitalCamel") private String capitalCamel = null; - + @JsonProperty("small_Snake") private String smallSnake = null; - + @JsonProperty("Capital_Snake") private String capitalSnake = null; - + @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints = null; - + @JsonProperty("ATT_NAME") private String ATT_NAME = null; - + public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; return this; } - /** - * Get smallCamel - * @return smallCamel + + /** + * Get smallCamel + * @return smallCamel **/ @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } - public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } - + public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; return this; } - /** - * Get capitalCamel - * @return capitalCamel + + /** + * Get capitalCamel + * @return capitalCamel **/ @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } - public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } - + public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; return this; } - /** - * Get smallSnake - * @return smallSnake + + /** + * Get smallSnake + * @return smallSnake **/ @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } - public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } - + public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; return this; } - /** - * Get capitalSnake - * @return capitalSnake + + /** + * Get capitalSnake + * @return capitalSnake **/ @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } - public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } - + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; return this; } - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints **/ @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } - public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } - + public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; return this; } - /** - * Name of the pet - * @return ATT_NAME + + /** + * Name of the pet + * @return ATT_NAME **/ @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } - public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -173,8 +173,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -201,5 +200,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Cat.java index b882da0ad90..d6e94912f06 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Cat.java @@ -26,28 +26,70 @@ */ public class Cat extends Animal { + + @JsonProperty("className") + private String className = null; + + @JsonProperty("color") + private String color = "red"; + @JsonProperty("declawed") private Boolean declawed = null; + + public Cat className(String className) { + this.className = className; + return this; + } + + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Cat color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; } - /** - * Get declawed - * @return declawed + + /** + * Get declawed + * @return declawed **/ @ApiModelProperty(value = "") public Boolean isDeclawed() { return declawed; } - public void setDeclawed(Boolean declawed) { this.declawed = declawed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -57,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && + return Objects.equals(this.className, cat.className) && + Objects.equals(this.color, cat.color) && + Objects.equals(this.declawed, cat.declawed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(declawed, super.hashCode()); + return Objects.hash(className, color, declawed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); sb.append("}"); return sb.toString(); @@ -88,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Category.java index 464f4375c4b..5ef89bf53cf 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Category.java @@ -25,49 +25,49 @@ */ public class Category { + @JsonProperty("id") private Long id = null; - + @JsonProperty("name") private String name = null; - + public Category id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Category name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -85,8 +85,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -109,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ClassModel.java index 4f764fde68d..887733b7310 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ClassModel.java @@ -22,32 +22,31 @@ /** * Model for testing model with \"_class\" property - */ -@ApiModel(description = "Model for testing model with \"_class\" property") + */@ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { + @JsonProperty("_class") private String propertyClass = null; - + public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,8 +63,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -87,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Client.java index a7c4253499c..6193700c6ca 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Client.java @@ -25,28 +25,28 @@ */ public class Client { + @JsonProperty("client") private String client = null; - + public Client client(String client) { this.client = client; return this; } - /** - * Get client - * @return client + + /** + * Get client + * @return client **/ @ApiModelProperty(value = "") public String getClient() { return client; } - public void setClient(String client) { this.client = client; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,8 +63,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(client); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -86,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Dog.java index 7de179b2ade..bffa0917362 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Dog.java @@ -26,28 +26,70 @@ */ public class Dog extends Animal { + + @JsonProperty("className") + private String className = null; + + @JsonProperty("color") + private String color = "red"; + @JsonProperty("breed") private String breed = null; + + public Dog className(String className) { + this.className = className; + return this; + } + + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Dog color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Dog breed(String breed) { this.breed = breed; return this; } - /** - * Get breed - * @return breed + + /** + * Get breed + * @return breed **/ @ApiModelProperty(value = "") public String getBreed() { return breed; } - public void setBreed(String breed) { this.breed = breed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -57,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && + return Objects.equals(this.className, dog.className) && + Objects.equals(this.color, dog.color) && + Objects.equals(this.breed, dog.breed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(breed, super.hashCode()); + return Objects.hash(className, color, breed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); sb.append("}"); return sb.toString(); @@ -88,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java index 133a31f10b9..c46a90c300a 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java @@ -27,12 +27,13 @@ */ public class EnumArrays { - /** + + /** * Gets or Sets justSymbol */ public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), + GREATER_THAN_OR_EQUAL_TO(">="), DOLLAR("$"); private String value; @@ -40,8 +41,9 @@ public enum JustSymbolEnum { JustSymbolEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -50,8 +52,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static JustSymbolEnum fromValue(String text) { for (JustSymbolEnum b : JustSymbolEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -60,17 +63,20 @@ public static JustSymbolEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("just_symbol") private JustSymbolEnum justSymbol = null; - - /** + + + /** * Gets or Sets arrayEnum */ public enum ArrayEnumEnum { - FISH("fish"), + FISH("fish"), CRAB("crab"); private String value; @@ -78,8 +84,9 @@ public enum ArrayEnumEnum { ArrayEnumEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -88,8 +95,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static ArrayEnumEnum fromValue(String text) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -98,56 +106,57 @@ public static ArrayEnumEnum fromValue(String text) { } return null; } + } - + @JsonProperty("array_enum") private List arrayEnum = null; - + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; return this; } - /** - * Get justSymbol - * @return justSymbol + + /** + * Get justSymbol + * @return justSymbol **/ @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } - public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } - + public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; return this; } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { this.arrayEnum = new ArrayList<>(); } + this.arrayEnum.add(arrayEnumItem); return this; } - - /** - * Get arrayEnum - * @return arrayEnum + + /** + * Get arrayEnum + * @return arrayEnum **/ @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } - public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -165,8 +174,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -189,5 +197,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumClass.java index abbd7a56668..9414211ef6c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumClass.java @@ -13,14 +13,17 @@ package io.swagger.client.model; -import java.util.Objects; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + + /** * Gets or Sets EnumClass */ + public enum EnumClass { _ABC("_abc"), @@ -35,7 +38,9 @@ public enum EnumClass { this.value = value; } + @JsonValue + public String getValue() { return value; } @@ -45,7 +50,9 @@ public String toString() { return String.valueOf(value); } + @JsonCreator + public static EnumClass fromValue(String text) { for (EnumClass b : EnumClass.values()) { if (String.valueOf(b.value).equals(text)) { @@ -54,5 +61,8 @@ public static EnumClass fromValue(String text) { } return null; } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java index 93d0da037b6..4634e7018db 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java @@ -26,14 +26,14 @@ */ public class EnumTest { - /** + + /** * Gets or Sets enumString */ public enum EnumStringEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"), - EMPTY(""); private String value; @@ -41,8 +41,9 @@ public enum EnumStringEnum { EnumStringEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -51,8 +52,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumStringEnum fromValue(String text) { for (EnumStringEnum b : EnumStringEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -61,17 +63,19 @@ public static EnumStringEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_string") private EnumStringEnum enumString = null; - - /** + + /** * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(1), NUMBER_MINUS_1(-1); private Integer value; @@ -79,8 +83,9 @@ public enum EnumIntegerEnum { EnumIntegerEnum(Integer value) { this.value = value; } - + @JsonValue + public Integer getValue() { return value; } @@ -89,8 +94,9 @@ public Integer getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumIntegerEnum fromValue(String text) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -99,17 +105,19 @@ public static EnumIntegerEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger = null; - - /** + + /** * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(1.1), NUMBER_MINUS_1_DOT_2(-1.2); private Double value; @@ -117,8 +125,9 @@ public enum EnumNumberEnum { EnumNumberEnum(Double value) { this.value = value; } - + @JsonValue + public Double getValue() { return value; } @@ -127,8 +136,9 @@ public Double getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumNumberEnum fromValue(String text) { for (EnumNumberEnum b : EnumNumberEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -137,87 +147,88 @@ public static EnumNumberEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_number") private EnumNumberEnum enumNumber = null; - + @JsonProperty("outerEnum") private OuterEnum outerEnum = null; - + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; } - /** - * Get enumString - * @return enumString + + /** + * Get enumString + * @return enumString **/ @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } - public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } - + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; } - /** - * Get enumInteger - * @return enumInteger + + /** + * Get enumInteger + * @return enumInteger **/ @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } - public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } - + public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; return this; } - /** - * Get enumNumber - * @return enumNumber + + /** + * Get enumNumber + * @return enumNumber **/ @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } - public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - + public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; return this; } - /** - * Get outerEnum - * @return outerEnum + + /** + * Get outerEnum + * @return outerEnum **/ @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -237,8 +248,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -263,5 +273,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java index 3fba5124727..7d0183878f0 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/FormatTest.java @@ -29,290 +29,284 @@ */ public class FormatTest { + @JsonProperty("integer") private Integer integer = null; - + @JsonProperty("int32") private Integer int32 = null; - + @JsonProperty("int64") private Long int64 = null; - + @JsonProperty("number") private BigDecimal number = null; - + @JsonProperty("float") private Float _float = null; - + @JsonProperty("double") private Double _double = null; - + @JsonProperty("string") private String string = null; - + @JsonProperty("byte") - private byte[] _byte = null; - + private String _byte = null; + @JsonProperty("binary") - private byte[] binary = null; - + private String binary = null; + @JsonProperty("date") private LocalDate date = null; - + @JsonProperty("dateTime") private OffsetDateTime dateTime = null; - + @JsonProperty("uuid") private UUID uuid = null; - + @JsonProperty("password") private String password = null; - + public FormatTest integer(Integer integer) { this.integer = integer; return this; } - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer **/ @ApiModelProperty(value = "") public Integer getInteger() { return integer; } - public void setInteger(Integer integer) { this.integer = integer; } - + public FormatTest int32(Integer int32) { this.int32 = int32; return this; } - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 **/ @ApiModelProperty(value = "") public Integer getInt32() { return int32; } - public void setInt32(Integer int32) { this.int32 = int32; } - + public FormatTest int64(Long int64) { this.int64 = int64; return this; } - /** - * Get int64 - * @return int64 + + /** + * Get int64 + * @return int64 **/ @ApiModelProperty(value = "") public Long getInt64() { return int64; } - public void setInt64(Long int64) { this.int64 = int64; } - + public FormatTest number(BigDecimal number) { this.number = number; return this; } - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number + + /** + * Get number + * @return number **/ @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } - public void setNumber(BigDecimal number) { this.number = number; } - + public FormatTest _float(Float _float) { this._float = _float; return this; } - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float + + /** + * Get _float + * @return _float **/ @ApiModelProperty(value = "") public Float getFloat() { return _float; } - public void setFloat(Float _float) { this._float = _float; } - + public FormatTest _double(Double _double) { this._double = _double; return this; } - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double + + /** + * Get _double + * @return _double **/ @ApiModelProperty(value = "") public Double getDouble() { return _double; } - public void setDouble(Double _double) { this._double = _double; } - + public FormatTest string(String string) { this.string = string; return this; } - /** - * Get string - * @return string + + /** + * Get string + * @return string **/ @ApiModelProperty(value = "") public String getString() { return string; } - public void setString(String string) { this.string = string; } - - public FormatTest _byte(byte[] _byte) { + + public FormatTest _byte(String _byte) { this._byte = _byte; return this; } - /** - * Get _byte - * @return _byte + + /** + * Get _byte + * @return _byte **/ @ApiModelProperty(required = true, value = "") - public byte[] getByte() { + public String getByte() { return _byte; } - - public void setByte(byte[] _byte) { + public void setByte(String _byte) { this._byte = _byte; } - - public FormatTest binary(byte[] binary) { + + public FormatTest binary(String binary) { this.binary = binary; return this; } - /** - * Get binary - * @return binary + + /** + * Get binary + * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public String getBinary() { return binary; } - - public void setBinary(byte[] binary) { + public void setBinary(String binary) { this.binary = binary; } - + public FormatTest date(LocalDate date) { this.date = date; return this; } - /** - * Get date - * @return date + + /** + * Get date + * @return date **/ @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } - public void setDate(LocalDate date) { this.date = date; } - + public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public FormatTest password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -341,8 +335,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -376,5 +369,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 6dc9f12c4b8..98a721fb9dc 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -25,31 +25,33 @@ */ public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar = null; - + @JsonProperty("foo") private String foo = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - - /** - * Get foo - * @return foo + + + /** + * Get foo + * @return foo **/ @ApiModelProperty(value = "") public String getFoo() { return foo; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,8 +69,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, foo); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -91,5 +92,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java index 31a7dae7253..cc0556cfb88 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java @@ -28,15 +28,17 @@ */ public class MapTest { + @JsonProperty("map_map_of_string") private Map> mapMapOfString = null; - - /** + + + /** * Gets or Sets inner */ public enum InnerEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"); private String value; @@ -44,8 +46,9 @@ public enum InnerEnum { InnerEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -54,8 +57,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static InnerEnum fromValue(String text) { for (InnerEnum b : InnerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -64,64 +68,64 @@ public static InnerEnum fromValue(String text) { } return null; } + } - + @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; - + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { this.mapMapOfString = new HashMap<>(); } + this.mapMapOfString.put(key, mapMapOfStringItem); return this; } - - /** - * Get mapMapOfString - * @return mapMapOfString + /** + * Get mapMapOfString + * @return mapMapOfString **/ @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } - public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } - + public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; return this; } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { this.mapOfEnumString = new HashMap<>(); } + this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } - - /** - * Get mapOfEnumString - * @return mapOfEnumString + /** + * Get mapOfEnumString + * @return mapOfEnumString **/ @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } - public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -139,8 +143,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -163,5 +166,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 98c2ad2cc78..2c50ee7becc 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -31,78 +31,78 @@ */ public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid = null; - + @JsonProperty("dateTime") private OffsetDateTime dateTime = null; - + @JsonProperty("map") private Map map = null; - + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; return this; } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { this.map = new HashMap<>(); } + this.map.put(key, mapItem); return this; } - - /** - * Get map - * @return map + /** + * Get map + * @return map **/ @ApiModelProperty(value = "") public Map getMap() { return map; } - public void setMap(Map map) { this.map = map; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -121,8 +121,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(uuid, dateTime, map); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -146,5 +145,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 58624475e43..606b051c2ea 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 @@ -22,53 +22,52 @@ /** * Model for testing model name starting with number - */ -@ApiModel(description = "Model for testing model name starting with number") + */@ApiModel(description = "Model for testing model name starting with number") public class Model200Response { + @JsonProperty("name") private Integer name = null; - + @JsonProperty("class") private String propertyClass = null; - + public Model200Response name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - + public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -86,8 +85,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -110,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelApiResponse.java index b010e53b48c..4002f3f632e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -25,70 +25,70 @@ */ public class ModelApiResponse { + @JsonProperty("code") private Integer code = null; - + @JsonProperty("type") private String type = null; - + @JsonProperty("message") private String message = null; - + public ModelApiResponse code(Integer code) { this.code = code; return this; } - /** - * Get code - * @return code + + /** + * Get code + * @return code **/ @ApiModelProperty(value = "") public Integer getCode() { return code; } - public void setCode(Integer code) { this.code = code; } - + public ModelApiResponse type(String type) { this.type = type; return this; } - /** - * Get type - * @return type + + /** + * Get type + * @return type **/ @ApiModelProperty(value = "") public String getType() { return type; } - public void setType(String type) { this.type = type; } - + public ModelApiResponse message(String message) { this.message = message; return this; } - /** - * Get message - * @return message + + /** + * Get message + * @return message **/ @ApiModelProperty(value = "") public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -107,8 +107,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(code, type, message); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -132,5 +131,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelReturn.java index 27d08557248..685e5ba93ac 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelReturn.java @@ -22,32 +22,31 @@ /** * Model for testing reserved words - */ -@ApiModel(description = "Model for testing reserved words") + */@ApiModel(description = "Model for testing reserved words") public class ModelReturn { + @JsonProperty("return") private Integer _return = null; - + public ModelReturn _return(Integer _return) { this._return = _return; return this; } - /** - * Get _return - * @return _return + + /** + * Get _return + * @return _return **/ @ApiModelProperty(value = "") public Integer getReturn() { return _return; } - public void setReturn(Integer _return) { this._return = _return; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,8 +63,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(_return); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -87,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 f2b9b1703bd..7c94ab233c2 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 @@ -22,77 +22,78 @@ /** * Model for testing model name same as property name - */ -@ApiModel(description = "Model for testing model name same as property name") + */@ApiModel(description = "Model for testing model name same as property name") public class Name { + @JsonProperty("name") private Integer name = null; - + @JsonProperty("snake_case") private Integer snakeCase = null; - + @JsonProperty("property") private String property = null; - + @JsonProperty("123Number") private Integer _123Number = null; - + public Name name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - - /** - * Get snakeCase - * @return snakeCase + + + /** + * Get snakeCase + * @return snakeCase **/ @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } - + public Name property(String property) { this.property = property; return this; } - /** - * Get property - * @return property + + /** + * Get property + * @return property **/ @ApiModelProperty(value = "") public String getProperty() { return property; } - public void setProperty(String property) { this.property = property; } - - /** - * Get _123Number - * @return _123Number + + + /** + * Get _123Number + * @return _123Number **/ @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,8 +113,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, snakeCase, property, _123Number); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -138,5 +138,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/NumberOnly.java index ec93aba0531..dc53f9e50dc 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/NumberOnly.java @@ -26,28 +26,28 @@ */ public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber = null; - + public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; return this; } - /** - * Get justNumber - * @return justNumber + + /** + * Get justNumber + * @return justNumber **/ @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } - public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,8 +64,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -87,5 +86,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java index 55f9a8dba21..fe5a686208f 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java @@ -26,26 +26,26 @@ */ public class Order { + @JsonProperty("id") private Long id = null; - + @JsonProperty("petId") private Long petId = null; - + @JsonProperty("quantity") private Integer quantity = null; - + @JsonProperty("shipDate") private OffsetDateTime shipDate = null; - - /** + + /** * Order Status */ public enum StatusEnum { - PLACED("placed"), + PLACED("placed"), APPROVED("approved"), - DELIVERED("delivered"); private String value; @@ -53,8 +53,9 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -63,8 +64,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -73,123 +75,124 @@ public static StatusEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("status") private StatusEnum status = null; - + @JsonProperty("complete") private Boolean complete = false; - + public Order id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Order petId(Long petId) { this.petId = petId; return this; } - /** - * Get petId - * @return petId + + /** + * Get petId + * @return petId **/ @ApiModelProperty(value = "") public Long getPetId() { return petId; } - public void setPetId(Long petId) { this.petId = petId; } - + public Order quantity(Integer quantity) { this.quantity = quantity; return this; } - /** - * Get quantity - * @return quantity + + /** + * Get quantity + * @return quantity **/ @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } - public void setQuantity(Integer quantity) { this.quantity = quantity; } - + public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; return this; } - /** - * Get shipDate - * @return shipDate + + /** + * Get shipDate + * @return shipDate **/ @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } - public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } - + public Order status(StatusEnum status) { this.status = status; return this; } - /** - * Order Status - * @return status + + /** + * Order Status + * @return status **/ @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - + public Order complete(Boolean complete) { this.complete = complete; return this; } - /** - * Get complete - * @return complete + + /** + * Get complete + * @return complete **/ @ApiModelProperty(value = "") public Boolean isComplete() { return complete; } - public void setComplete(Boolean complete) { this.complete = complete; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -211,8 +214,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -239,5 +241,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterComposite.java index 02c16a99b70..8b957f45a14 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterComposite.java @@ -26,70 +26,70 @@ */ public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber = null; - + @JsonProperty("my_string") private String myString = null; - + @JsonProperty("my_boolean") private Boolean myBoolean = null; - + public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; return this; } - /** - * Get myNumber - * @return myNumber + + /** + * Get myNumber + * @return myNumber **/ @ApiModelProperty(value = "") public BigDecimal getMyNumber() { return myNumber; } - public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } - + public OuterComposite myString(String myString) { this.myString = myString; return this; } - /** - * Get myString - * @return myString + + /** + * Get myString + * @return myString **/ @ApiModelProperty(value = "") public String getMyString() { return myString; } - public void setMyString(String myString) { this.myString = myString; } - + public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; return this; } - /** - * Get myBoolean - * @return myBoolean + + /** + * Get myBoolean + * @return myBoolean **/ @ApiModelProperty(value = "") public Boolean getMyBoolean() { return myBoolean; } - public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -108,8 +108,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(myNumber, myString, myBoolean); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -133,5 +132,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterEnum.java index 948d80c2e6d..3390d473c7b 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterEnum.java @@ -13,14 +13,17 @@ package io.swagger.client.model; -import java.util.Objects; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + + /** * Gets or Sets OuterEnum */ + public enum OuterEnum { PLACED("placed"), @@ -35,7 +38,9 @@ public enum OuterEnum { this.value = value; } + @JsonValue + public String getValue() { return value; } @@ -45,7 +50,9 @@ public String toString() { return String.valueOf(value); } + @JsonCreator + public static OuterEnum fromValue(String text) { for (OuterEnum b : OuterEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -54,5 +61,8 @@ public static OuterEnum fromValue(String text) { } return null; } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java index 6ece90bbfc3..2bda9b34787 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java @@ -29,29 +29,29 @@ */ public class Pet { + @JsonProperty("id") private Long id = null; - + @JsonProperty("category") private Category category = null; - + @JsonProperty("name") private String name = null; - + @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); - + @JsonProperty("tags") private List tags = null; - - /** + + /** * pet status in the store */ public enum StatusEnum { - AVAILABLE("available"), + AVAILABLE("available"), PENDING("pending"), - SOLD("sold"); private String value; @@ -59,8 +59,9 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -69,8 +70,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -79,133 +81,135 @@ public static StatusEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("status") private StatusEnum status = null; - + public Pet id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Pet category(Category category) { this.category = category; return this; } - /** - * Get category - * @return category + + /** + * Get category + * @return category **/ @ApiModelProperty(value = "") public Category getCategory() { return category; } - public void setCategory(Category category) { this.category = category; } - + public Pet name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - + public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); return this; } - - /** - * Get photoUrls - * @return photoUrls + + /** + * Get photoUrls + * @return photoUrls **/ @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } - + public Pet tags(List tags) { this.tags = tags; return this; } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { this.tags = new ArrayList<>(); } + this.tags.add(tagsItem); return this; } - - /** - * Get tags - * @return tags + + /** + * Get tags + * @return tags **/ @ApiModelProperty(value = "") public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } - + public Pet status(StatusEnum status) { this.status = status; return this; } - /** - * pet status in the store - * @return status + + /** + * pet status in the store + * @return status **/ @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -227,8 +231,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -255,5 +258,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 76f8a912f36..1532a30b9e9 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -25,40 +25,41 @@ */ public class ReadOnlyFirst { + @JsonProperty("bar") private String bar = null; - + @JsonProperty("baz") private String baz = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; } - /** - * Get baz - * @return baz + + /** + * Get baz + * @return baz **/ @ApiModelProperty(value = "") public String getBaz() { return baz; } - public void setBaz(String baz) { this.baz = baz; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -76,8 +77,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, baz); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,5 +100,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 784eb8baca8..38b54fd6c38 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 @@ -25,28 +25,28 @@ */ public class SpecialModelName { - @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + @JsonProperty("$special[property.name]") + private Long $specialPropertyName = null; + + 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; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -55,22 +55,21 @@ public boolean equals(java.lang.Object o) { 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); } - - + @Override public String toString() { 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(); } @@ -86,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Tag.java index 1cf2f5bc5e6..2967322b174 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Tag.java @@ -25,49 +25,49 @@ */ public class Tag { + @JsonProperty("id") private Long id = null; - + @JsonProperty("name") private String name = null; - + public Tag id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Tag name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -85,8 +85,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -109,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/User.java index de5bc439c5a..cb2f9f34084 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/User.java @@ -25,175 +25,175 @@ */ public class User { + @JsonProperty("id") private Long id = null; - + @JsonProperty("username") private String username = null; - + @JsonProperty("firstName") private String firstName = null; - + @JsonProperty("lastName") private String lastName = null; - + @JsonProperty("email") private String email = null; - + @JsonProperty("password") private String password = null; - + @JsonProperty("phone") private String phone = null; - + @JsonProperty("userStatus") private Integer userStatus = null; - + public User id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public User username(String username) { this.username = username; return this; } - /** - * Get username - * @return username + + /** + * Get username + * @return username **/ @ApiModelProperty(value = "") public String getUsername() { return username; } - public void setUsername(String username) { this.username = username; } - + public User firstName(String firstName) { this.firstName = firstName; return this; } - /** - * Get firstName - * @return firstName + + /** + * Get firstName + * @return firstName **/ @ApiModelProperty(value = "") public String getFirstName() { return firstName; } - public void setFirstName(String firstName) { this.firstName = firstName; } - + public User lastName(String lastName) { this.lastName = lastName; return this; } - /** - * Get lastName - * @return lastName + + /** + * Get lastName + * @return lastName **/ @ApiModelProperty(value = "") public String getLastName() { return lastName; } - public void setLastName(String lastName) { this.lastName = lastName; } - + public User email(String email) { this.email = email; return this; } - /** - * Get email - * @return email + + /** + * Get email + * @return email **/ @ApiModelProperty(value = "") public String getEmail() { return email; } - public void setEmail(String email) { this.email = email; } - + public User password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - + public User phone(String phone) { this.phone = phone; return this; } - /** - * Get phone - * @return phone + + /** + * Get phone + * @return phone **/ @ApiModelProperty(value = "") public String getPhone() { return phone; } - public void setPhone(String phone) { this.phone = phone; } - + public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; } - /** - * User Status - * @return userStatus + + /** + * User Status + * @return userStatus **/ @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } - public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -217,8 +217,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -247,5 +246,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..f2b031f9485 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 @@ -15,14 +15,17 @@ import io.swagger.client.ApiException; import io.swagger.client.model.Client; + 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 AnotherFakeApi */ @@ -42,8 +45,10 @@ 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/FakeApiTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/FakeApiTest.java index 9a7e76c1552..9710cbe6764 100644 --- a/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -16,17 +16,18 @@ import io.swagger.client.ApiException; import java.math.BigDecimal; import io.swagger.client.model.Client; -import java.time.LocalDate; -import java.time.OffsetDateTime; import io.swagger.client.model.OuterComposite; + 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 FakeApi */ @@ -46,7 +47,9 @@ public class FakeApiTest { */ @Test public void fakeOuterBooleanSerializeTest() throws ApiException { + Boolean body = null; + Boolean response = api.fakeOuterBooleanSerialize(body); // TODO: test validations @@ -62,8 +65,10 @@ public void fakeOuterBooleanSerializeTest() throws ApiException { */ @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 } @@ -78,7 +83,9 @@ public void fakeOuterCompositeSerializeTest() throws ApiException { */ @Test public void fakeOuterNumberSerializeTest() throws ApiException { + BigDecimal body = null; + BigDecimal response = api.fakeOuterNumberSerialize(body); // TODO: test validations @@ -94,7 +101,9 @@ public void fakeOuterNumberSerializeTest() throws ApiException { */ @Test public void fakeOuterStringSerializeTest() throws ApiException { + String body = null; + String response = api.fakeOuterStringSerialize(body); // TODO: test validations @@ -110,8 +119,10 @@ public void fakeOuterStringSerializeTest() throws ApiException { */ @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 } @@ -126,21 +137,10 @@ public void testClientModelTest() throws ApiException { */ @Test public void testEndpointParametersTest() throws ApiException { - BigDecimal number = null; - Double _double = null; - String patternWithoutDelimiter = null; - byte[] _byte = null; - Integer integer = null; - Integer int32 = null; - Long int64 = null; - Float _float = null; - String string = null; - byte[] binary = null; - LocalDate date = null; - OffsetDateTime dateTime = null; - String password = null; - String paramCallback = null; - api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + + Object body = null; + + api.testEndpointParameters(body); // TODO: test validations } @@ -155,15 +155,20 @@ public void testEndpointParametersTest() throws ApiException { */ @Test public void testEnumParametersTest() throws ApiException { - List enumFormStringArray = null; - String enumFormString = null; + + Object body = 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); + + api.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); // TODO: test validations } @@ -178,8 +183,10 @@ public void testEnumParametersTest() throws ApiException { */ @Test public void testInlineAdditionalPropertiesTest() throws ApiException { - Object param = null; - api.testInlineAdditionalProperties(param); + + Map body = null; + + api.testInlineAdditionalProperties(body); // TODO: test validations } @@ -194,9 +201,10 @@ public void testInlineAdditionalPropertiesTest() throws ApiException { */ @Test public void testJsonFormDataTest() throws ApiException { - String param = null; - String param2 = null; - api.testJsonFormData(param, param2); + + Object body = null; + + api.testJsonFormData(body); // 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..dbda3faa692 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 @@ -15,14 +15,17 @@ import io.swagger.client.ApiException; import io.swagger.client.model.Client; + 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 FakeClassnameTags123Api */ @@ -42,8 +45,10 @@ 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/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..f02c13872eb 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 @@ -14,17 +14,19 @@ 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 */ @@ -44,8 +46,10 @@ public class PetApiTest { */ @Test public void addPetTest() throws ApiException { - Pet body = null; - api.addPet(body); + + Pet pet = null; + + api.addPet(pet); // TODO: test validations } @@ -60,8 +64,11 @@ public void addPetTest() throws ApiException { */ @Test public void deletePetTest() throws ApiException { - Long petId = null; + + Integer petId = null; + String apiKey = null; + api.deletePet(petId, apiKey); // TODO: test validations @@ -77,7 +84,9 @@ public void deletePetTest() throws ApiException { */ @Test public void findPetsByStatusTest() throws ApiException { + List status = null; + List response = api.findPetsByStatus(status); // TODO: test validations @@ -93,7 +102,9 @@ public void findPetsByStatusTest() throws ApiException { */ @Test public void findPetsByTagsTest() throws ApiException { + List tags = null; + List response = api.findPetsByTags(tags); // TODO: test validations @@ -109,7 +120,9 @@ public void findPetsByTagsTest() throws ApiException { */ @Test public void getPetByIdTest() throws ApiException { - Long petId = null; + + Integer petId = null; + Pet response = api.getPetById(petId); // TODO: test validations @@ -125,8 +138,10 @@ public void getPetByIdTest() throws ApiException { */ @Test public void updatePetTest() throws ApiException { - Pet body = null; - api.updatePet(body); + + Pet pet = null; + + api.updatePet(pet); // TODO: test validations } @@ -141,10 +156,12 @@ public void updatePetTest() throws ApiException { */ @Test public void updatePetWithFormTest() throws ApiException { - Long petId = null; - String name = null; - String status = null; - api.updatePetWithForm(petId, name, status); + + Integer petId = null; + + Object body = null; + + api.updatePetWithForm(petId, body); // TODO: test validations } @@ -159,10 +176,12 @@ public void updatePetWithFormTest() throws ApiException { */ @Test public void uploadFileTest() throws ApiException { - Long petId = null; - String additionalMetadata = null; - File file = null; - ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + + Integer petId = null; + + Object body = null; + + ModelApiResponse response = api.uploadFile(petId, body); // 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..c6d9b89f0bd 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 @@ -15,14 +15,17 @@ 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 */ @@ -42,7 +45,9 @@ public class StoreApiTest { */ @Test public void deleteOrderTest() throws ApiException { + String orderId = null; + api.deleteOrder(orderId); // TODO: test validations @@ -58,6 +63,7 @@ public void deleteOrderTest() throws ApiException { */ @Test public void getInventoryTest() throws ApiException { + Map response = api.getInventory(); // TODO: test validations @@ -73,7 +79,9 @@ public void getInventoryTest() throws ApiException { */ @Test public void getOrderByIdTest() throws ApiException { - Long orderId = null; + + Integer orderId = null; + Order response = api.getOrderById(orderId); // TODO: test validations @@ -89,8 +97,10 @@ public void getOrderByIdTest() throws ApiException { */ @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..175f42fca9c 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 @@ -15,14 +15,17 @@ 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 */ @@ -42,8 +45,10 @@ 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,7 +63,9 @@ public void createUserTest() throws ApiException { */ @Test public void createUsersWithArrayInputTest() throws ApiException { + List body = null; + api.createUsersWithArrayInput(body); // TODO: test validations @@ -74,7 +81,9 @@ public void createUsersWithArrayInputTest() throws ApiException { */ @Test public void createUsersWithListInputTest() throws ApiException { + List body = null; + api.createUsersWithListInput(body); // TODO: test validations @@ -90,7 +99,9 @@ public void createUsersWithListInputTest() throws ApiException { */ @Test public void deleteUserTest() throws ApiException { + String username = null; + api.deleteUser(username); // TODO: test validations @@ -106,7 +117,9 @@ public void deleteUserTest() throws ApiException { */ @Test public void getUserByNameTest() throws ApiException { + String username = null; + User response = api.getUserByName(username); // TODO: test validations @@ -122,8 +135,11 @@ public void getUserByNameTest() throws ApiException { */ @Test public void loginUserTest() throws ApiException { + String username = null; + String password = null; + String response = api.loginUser(username, password); // TODO: test validations @@ -139,6 +155,7 @@ public void loginUserTest() throws ApiException { */ @Test public void logoutUserTest() throws ApiException { + api.logoutUser(); // TODO: test validations @@ -154,9 +171,12 @@ public void logoutUserTest() throws ApiException { */ @Test public void updateUserTest() throws ApiException { + + User user = null; + String username = null; - User body = null; - api.updateUser(username, body); + + api.updateUser(user, username); // 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/.swagger-codegen/VERSION b/samples/client/petstore/java/jersey2/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/client/petstore/java/jersey2/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/jersey2/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2/README.md b/samples/client/petstore/java/jersey2/README.md index 8ceb02c6e3b..6008bb43bf2 100644 --- a/samples/client/petstore/java/jersey2/README.md +++ b/samples/client/petstore/java/jersey2/README.md @@ -69,11 +69,16 @@ import java.util.*; public class AnotherFakeApiExample { public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + AnotherFakeApi apiInstance = new AnotherFakeApi(); - Client body = new Client(); // Client | client model + + Client 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"); @@ -127,14 +132,15 @@ Class | Method | HTTP request | Description - [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) @@ -155,8 +161,6 @@ Class | Method | HTTP request | Description - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) - - [Cat](docs/Cat.md) - - [Dog](docs/Dog.md) ## Documentation for Authorization @@ -168,24 +172,37 @@ 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 - **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 diff --git a/samples/client/petstore/java/jersey2/build.gradle b/samples/client/petstore/java/jersey2/build.gradle index 585cdd96a55..8db877b606c 100644 --- a/samples/client/petstore/java/jersey2/build.gradle +++ b/samples/client/petstore/java/jersey2/build.gradle @@ -32,8 +32,11 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { + + sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 + } // Rename the aar correctly @@ -77,8 +80,11 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven' + + sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 + install { repositories.mavenInstaller { @@ -96,6 +102,7 @@ ext { swagger_annotations_version = "1.5.15" jackson_version = "2.8.9" jersey_version = "2.25.1" + junit_version = "4.12" } @@ -107,7 +114,14 @@ dependencies { compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" + + + + compile "com.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/jersey2/build.sbt b/samples/client/petstore/java/jersey2/build.sbt index c6d1b925753..104f7126e1b 100644 --- a/samples/client/petstore/java/jersey2/build.sbt +++ b/samples/client/petstore/java/jersey2/build.sbt @@ -16,8 +16,15 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-core" % "2.6.4" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.6.4" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.6.4" % "compile", + + + "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.6.4" % "compile", + + "com.brsanthu" % "migbase64" % "2.2", + + "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) diff --git a/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesClass.md index 0437c4dd8cc..b37862da7cf 100644 --- a/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/java/jersey2/docs/AdditionalPropertiesClass.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2/docs/Animal.md b/samples/client/petstore/java/jersey2/docs/Animal.md index b3f325c3524..346caaf63f4 100644 --- a/samples/client/petstore/java/jersey2/docs/Animal.md +++ b/samples/client/petstore/java/jersey2/docs/Animal.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2/docs/AnimalFarm.md b/samples/client/petstore/java/jersey2/docs/AnimalFarm.md deleted file mode 100644 index c7c7f1ddcce..00000000000 --- a/samples/client/petstore/java/jersey2/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ - -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - diff --git a/samples/client/petstore/java/jersey2/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey2/docs/AnotherFakeApi.md index 7a04619aaba..fb5c988e6cc 100644 --- a/samples/client/petstore/java/jersey2/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/jersey2/docs/AnotherFakeApi.md @@ -7,9 +7,11 @@ Method | HTTP request | Description [**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -22,10 +24,13 @@ To test special tags //import io.swagger.client.api.AnotherFakeApi; + AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +42,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -52,3 +58,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + + 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/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/jersey2/docs/ArrayOfArrayOfNumberOnly.md index 77292549927..3671a5e9190 100644 --- a/samples/client/petstore/java/jersey2/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/java/jersey2/docs/ArrayOfArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/jersey2/docs/ArrayOfNumberOnly.md index e8cc4cd36dc..30b9b6648f4 100644 --- a/samples/client/petstore/java/jersey2/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/java/jersey2/docs/ArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2/docs/ArrayTest.md b/samples/client/petstore/java/jersey2/docs/ArrayTest.md index 9feee16427f..4ab76343030 100644 --- a/samples/client/petstore/java/jersey2/docs/ArrayTest.md +++ b/samples/client/petstore/java/jersey2/docs/ArrayTest.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2/docs/Capitalization.md b/samples/client/petstore/java/jersey2/docs/Capitalization.md index 0f3064c1996..9af7864f97e 100644 --- a/samples/client/petstore/java/jersey2/docs/Capitalization.md +++ b/samples/client/petstore/java/jersey2/docs/Capitalization.md @@ -13,3 +13,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2/docs/Cat.md b/samples/client/petstore/java/jersey2/docs/Cat.md index 6e9f71ce7dd..5e408344021 100644 --- a/samples/client/petstore/java/jersey2/docs/Cat.md +++ b/samples/client/petstore/java/jersey2/docs/Cat.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **declawed** | **Boolean** | | [optional] + diff --git a/samples/client/petstore/java/jersey2/docs/Category.md b/samples/client/petstore/java/jersey2/docs/Category.md index e2df0803278..deb5a3e2a52 100644 --- a/samples/client/petstore/java/jersey2/docs/Category.md +++ b/samples/client/petstore/java/jersey2/docs/Category.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2/docs/ClassModel.md b/samples/client/petstore/java/jersey2/docs/ClassModel.md index 64f880c8786..49c281cc0ed 100644 --- a/samples/client/petstore/java/jersey2/docs/ClassModel.md +++ b/samples/client/petstore/java/jersey2/docs/ClassModel.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2/docs/Client.md b/samples/client/petstore/java/jersey2/docs/Client.md index 5c490ea166c..52b2f72c79c 100644 --- a/samples/client/petstore/java/jersey2/docs/Client.md +++ b/samples/client/petstore/java/jersey2/docs/Client.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2/docs/Dog.md b/samples/client/petstore/java/jersey2/docs/Dog.md index ac7cea323ff..00e6446e9f5 100644 --- a/samples/client/petstore/java/jersey2/docs/Dog.md +++ b/samples/client/petstore/java/jersey2/docs/Dog.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **breed** | **String** | | [optional] + diff --git a/samples/client/petstore/java/jersey2/docs/EnumArrays.md b/samples/client/petstore/java/jersey2/docs/EnumArrays.md index 4dddc0bfd27..939a0e69587 100644 --- a/samples/client/petstore/java/jersey2/docs/EnumArrays.md +++ b/samples/client/petstore/java/jersey2/docs/EnumArrays.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] + ## Enum: JustSymbolEnum Name | Value @@ -20,8 +21,6 @@ DOLLAR | "$" ## Enum: List<ArrayEnumEnum> Name | Value ---- | ----- -FISH | "fish" -CRAB | "crab" diff --git a/samples/client/petstore/java/jersey2/docs/EnumTest.md b/samples/client/petstore/java/jersey2/docs/EnumTest.md index 08fee344882..9722c621962 100644 --- a/samples/client/petstore/java/jersey2/docs/EnumTest.md +++ b/samples/client/petstore/java/jersey2/docs/EnumTest.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] + ## Enum: EnumStringEnum Name | Value diff --git a/samples/client/petstore/java/jersey2/docs/FakeApi.md b/samples/client/petstore/java/jersey2/docs/FakeApi.md index 737ccc28293..6690b870e4e 100644 --- a/samples/client/petstore/java/jersey2/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2/docs/FakeApi.md @@ -15,6 +15,8 @@ Method | HTTP request | Description [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data + + # **fakeOuterBooleanSerialize** > Boolean fakeOuterBooleanSerialize(body) @@ -30,8 +32,11 @@ Test serialization of outer boolean types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body + +Boolean body = ; // Boolean | Input boolean as post body + try { Boolean result = apiInstance.fakeOuterBooleanSerialize(body); System.out.println(result); @@ -47,6 +52,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + ### Return type **Boolean** @@ -57,12 +63,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outercomposite) @@ -75,10 +82,13 @@ Test serialization of object with outer number type //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body + +OuterComposite 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 +100,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outercomposite** | [**OuterComposite**](.md)| Input composite as post body | [optional] + ### Return type @@ -102,8 +113,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterNumberSerialize** @@ -120,8 +132,11 @@ Test serialization of outer number types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body + +BigDecimal body = ; // BigDecimal | Input number as post body + try { BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); System.out.println(result); @@ -137,6 +152,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + ### Return type [**BigDecimal**](BigDecimal.md) @@ -147,8 +163,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterStringSerialize** @@ -165,8 +182,11 @@ Test serialization of outer string types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String body = "body_example"; // String | Input string as post body + +String body = ; // String | Input string as post body + try { String result = apiInstance.fakeOuterStringSerialize(body); System.out.println(result); @@ -182,6 +202,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**String**](String.md)| Input string as post body | [optional] + ### Return type **String** @@ -192,12 +213,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -210,10 +232,13 @@ To test \"client\" model //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +250,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -240,9 +266,10 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + # **testEndpointParameters** -> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) +> testEndpointParameters(body) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -251,36 +278,17 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### 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.FakeApi; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure HTTP basic authorization: http_basic_test -HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); -http_basic_test.setUsername("YOUR USERNAME"); -http_basic_test.setPassword("YOUR PASSWORD"); 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 -Integer integer = 56; // Integer | None -Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None -Float _float = 3.4F; // Float | None -String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None -LocalDate date = new LocalDate(); // LocalDate | None -OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None -String password = "password_example"; // String | None -String paramCallback = "paramCallback_example"; // String | None + +Object body = ; // Object | + try { - apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + apiInstance.testEndpointParameters(body); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEndpointParameters"); e.printStackTrace(); @@ -291,20 +299,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **BigDecimal**| None | - **_double** | **Double**| None | - **patternWithoutDelimiter** | **String**| None | - **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] - **int64** | **Long**| None | [optional] - **_float** | **Float**| None | [optional] - **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] - **date** | **LocalDate**| None | [optional] - **dateTime** | **OffsetDateTime**| None | [optional] - **password** | **String**| None | [optional] - **paramCallback** | **String**| None | [optional] + **body** | [**Object**](Object.md)| | + ### Return type @@ -317,11 +313,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 + - **Accept**: Not defined + # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger) To test enum parameters @@ -334,17 +331,23 @@ To test enum parameters //import io.swagger.client.api.FakeApi; + 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) + +Object body = ; // Object | + List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) -String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + +String enumHeaderString = Arrays.asList("enumHeaderString_example"); // 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) + +String enumQueryString = Arrays.asList("enumQueryString_example"); // String | Query parameter enum test (string) + +Integer enumQueryInteger = Arrays.asList(56); // Integer | Query parameter enum test (double) + try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -355,14 +358,13 @@ 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] + **body** | [**Object**](Object.md)| | [optional] + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: ] + **enumHeaderString** | [**String**](.md)| Header parameter enum test (string) | [optional] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: ] + **enumQueryString** | [**String**](.md)| Query parameter enum test (string) | [optional] + **enumQueryInteger** | [**Integer**](.md)| Query parameter enum test (double) | [optional] + ### Return type @@ -375,16 +377,15 @@ No authorization required ### HTTP request headers - **Content-Type**: */* - - **Accept**: */* + - **Accept**: Not defined + # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(body) test inline additionalProperties - - ### Example ```java // Import classes: @@ -392,10 +393,13 @@ test inline additionalProperties //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body + +Map body = ; // Map | request body + try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(body); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); e.printStackTrace(); @@ -406,7 +410,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **body** | [**Map<String, String>**](Map.md)| request body | + ### Return type @@ -421,14 +426,13 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined + # **testJsonFormData** -> testJsonFormData(param, param2) +> testJsonFormData(body) test json serialization of form data - - ### Example ```java // Import classes: @@ -436,11 +440,13 @@ test json serialization of form data //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String param = "param_example"; // String | field1 -String param2 = "param2_example"; // String | field2 + +Object body = ; // Object | + try { - apiInstance.testJsonFormData(param, param2); + apiInstance.testJsonFormData(body); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testJsonFormData"); e.printStackTrace(); @@ -451,8 +457,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **String**| field1 | - **param2** | **String**| field2 | + **body** | [**Object**](Object.md)| | + ### Return type @@ -467,3 +473,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined + + diff --git a/samples/client/petstore/java/jersey2/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/jersey2/docs/FakeClassnameTags123Api.md index bc728bfce5b..2bcbbb7908f 100644 --- a/samples/client/petstore/java/jersey2/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/jersey2/docs/FakeClassnameTags123Api.md @@ -7,33 +7,28 @@ Method | HTTP request | Description [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case ### 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.FakeClassnameTags123Api; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure API key authorization: api_key_query -ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); -api_key_query.setApiKey("YOUR API KEY"); -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model + +Client 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 +40,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -60,3 +56,5 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + + 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..bc11b93cb26 100644 --- a/samples/client/petstore/java/jersey2/docs/FormatTest.md +++ b/samples/client/petstore/java/jersey2/docs/FormatTest.md @@ -11,8 +11,8 @@ Name | Type | Description | Notes **_float** | **Float** | | [optional] **_double** | **Double** | | [optional] **string** | **String** | | [optional] -**_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**_byte** | **String** | | +**binary** | **String** | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] @@ -20,3 +20,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/jersey2/docs/HasOnlyReadOnly.md index c1d0aac5672..5564ddcf28a 100644 --- a/samples/client/petstore/java/jersey2/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/java/jersey2/docs/HasOnlyReadOnly.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + 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/MapTest.md b/samples/client/petstore/java/jersey2/docs/MapTest.md index 714a97a40d9..74a6fe8ae70 100644 --- a/samples/client/petstore/java/jersey2/docs/MapTest.md +++ b/samples/client/petstore/java/jersey2/docs/MapTest.md @@ -8,12 +8,11 @@ Name | Type | Description | Notes **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] + ## Enum: Map<String, InnerEnum> Name | Value ---- | ----- -UPPER | "UPPER" -LOWER | "lower" diff --git a/samples/client/petstore/java/jersey2/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/jersey2/docs/MixedPropertiesAndAdditionalPropertiesClass.md index b12e2cd70e6..4507481b5a9 100644 --- a/samples/client/petstore/java/jersey2/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/jersey2/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2/docs/Model200Response.md b/samples/client/petstore/java/jersey2/docs/Model200Response.md index 5b3a9a0e46d..8d2cc50bb83 100644 --- a/samples/client/petstore/java/jersey2/docs/Model200Response.md +++ b/samples/client/petstore/java/jersey2/docs/Model200Response.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2/docs/ModelApiResponse.md b/samples/client/petstore/java/jersey2/docs/ModelApiResponse.md index 3eec8686cc9..06052b202f1 100644 --- a/samples/client/petstore/java/jersey2/docs/ModelApiResponse.md +++ b/samples/client/petstore/java/jersey2/docs/ModelApiResponse.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2/docs/ModelReturn.md b/samples/client/petstore/java/jersey2/docs/ModelReturn.md index a679b04953e..a7845ba254b 100644 --- a/samples/client/petstore/java/jersey2/docs/ModelReturn.md +++ b/samples/client/petstore/java/jersey2/docs/ModelReturn.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2/docs/Name.md b/samples/client/petstore/java/jersey2/docs/Name.md index ce2fb4dee50..a8d6fec9714 100644 --- a/samples/client/petstore/java/jersey2/docs/Name.md +++ b/samples/client/petstore/java/jersey2/docs/Name.md @@ -11,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2/docs/NumberOnly.md b/samples/client/petstore/java/jersey2/docs/NumberOnly.md index a3feac7fadc..adfb36a95bb 100644 --- a/samples/client/petstore/java/jersey2/docs/NumberOnly.md +++ b/samples/client/petstore/java/jersey2/docs/NumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2/docs/Order.md b/samples/client/petstore/java/jersey2/docs/Order.md index 268c617d1ff..7e4beff6df1 100644 --- a/samples/client/petstore/java/jersey2/docs/Order.md +++ b/samples/client/petstore/java/jersey2/docs/Order.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/jersey2/docs/OuterComposite.md b/samples/client/petstore/java/jersey2/docs/OuterComposite.md index 3f5a633c998..1963c7a0f73 100644 --- a/samples/client/petstore/java/jersey2/docs/OuterComposite.md +++ b/samples/client/petstore/java/jersey2/docs/OuterComposite.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2/docs/Pet.md b/samples/client/petstore/java/jersey2/docs/Pet.md index 5b63109ef92..1492195a58d 100644 --- a/samples/client/petstore/java/jersey2/docs/Pet.md +++ b/samples/client/petstore/java/jersey2/docs/Pet.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/jersey2/docs/PetApi.md b/samples/client/petstore/java/jersey2/docs/PetApi.md index b5fa395947d..4758743434a 100644 --- a/samples/client/petstore/java/jersey2/docs/PetApi.md +++ b/samples/client/petstore/java/jersey2/docs/PetApi.md @@ -14,33 +14,28 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image + + # **addPet** -> addPet(body) +> addPet(pet) 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 + +Pet 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 +46,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -64,7 +60,8 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **deletePet** @@ -72,26 +69,20 @@ null (empty response body) 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 | + +Integer petId = Arrays.asList(56); // Integer | Pet id to delete + +String apiKey = Arrays.asList("apiKey_example"); // String | + try { apiInstance.deletePet(petId, apiKey); } catch (ApiException e) { @@ -104,8 +95,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | - **apiKey** | **String**| | [optional] + **petId** | [**Integer**](.md)| Pet id to delete | + **apiKey** | [**String**](.md)| | [optional] + ### Return type @@ -118,7 +110,8 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **findPetsByStatus** @@ -131,20 +124,15 @@ 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); @@ -158,7 +146,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: ] + ### Return type @@ -173,6 +162,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **findPetsByTags** > List<Pet> findPetsByTags(tags) @@ -184,20 +174,15 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### 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); @@ -213,6 +198,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | + ### Return type [**List<Pet>**](Pet.md) @@ -226,6 +212,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **getPetById** > Pet getPetById(petId) @@ -237,22 +224,15 @@ 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to return + try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -266,7 +246,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to return | + **petId** | [**Integer**](.md)| ID of pet to return | + ### Return type @@ -281,33 +262,27 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **updatePet** -> updatePet(body) +> updatePet(pet) 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 + +Pet 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 +293,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -331,37 +307,31 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updatePetWithForm** -> updatePetWithForm(petId, name, status) +> updatePetWithForm(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet that needs to be updated + +Object body = ; // Object | + try { - apiInstance.updatePetWithForm(petId, name, status); + apiInstance.updatePetWithForm(petId, body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePetWithForm"); e.printStackTrace(); @@ -372,9 +342,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet that needs to be updated | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -387,37 +357,31 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **uploadFile** -> ModelApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to update + +Object body = ; // Object | + try { - ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); + ModelApiResponse result = apiInstance.uploadFile(petId, body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFile"); @@ -429,9 +393,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet to update | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -446,3 +410,5 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json + + diff --git a/samples/client/petstore/java/jersey2/docs/ReadOnlyFirst.md b/samples/client/petstore/java/jersey2/docs/ReadOnlyFirst.md index 426b7cde95a..57655e5b49e 100644 --- a/samples/client/petstore/java/jersey2/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/java/jersey2/docs/ReadOnlyFirst.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2/docs/SpecialModelName.md b/samples/client/petstore/java/jersey2/docs/SpecialModelName.md index c2c6117c552..f4259d2a73c 100644 --- a/samples/client/petstore/java/jersey2/docs/SpecialModelName.md +++ b/samples/client/petstore/java/jersey2/docs/SpecialModelName.md @@ -4,7 +4,8 @@ ## 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..a4678ee745c 100644 --- a/samples/client/petstore/java/jersey2/docs/StoreApi.md +++ b/samples/client/petstore/java/jersey2/docs/StoreApi.md @@ -10,6 +10,8 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + # **deleteOrder** > deleteOrder(orderId) @@ -25,8 +27,11 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + +String orderId = Arrays.asList("orderId_example"); // String | ID of the order that needs to be deleted + try { apiInstance.deleteOrder(orderId); } catch (ApiException e) { @@ -39,7 +44,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | + **orderId** | [**String**](.md)| ID of the order that needs to be deleted | + ### Return type @@ -52,7 +58,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getInventory** @@ -65,21 +72,13 @@ 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); @@ -92,6 +91,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type **Map<String, Integer>** @@ -105,6 +105,7 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json + # **getOrderById** > Order getOrderById(orderId) @@ -120,8 +121,11 @@ For valid response try integer IDs with value <= 5 or > 10. Other val //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched + +Integer orderId = Arrays.asList(56); // Integer | ID of pet that needs to be fetched + try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +139,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | [**Integer**](.md)| ID of pet that needs to be fetched | + ### Return type @@ -150,14 +155,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -165,10 +169,13 @@ Place an order for a pet //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet + +Order 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 +187,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](.md)| order placed for purchasing the pet | + ### Return type @@ -192,6 +200,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: */* - **Accept**: application/xml, application/json + + diff --git a/samples/client/petstore/java/jersey2/docs/Tag.md b/samples/client/petstore/java/jersey2/docs/Tag.md index de6814b55d5..7a97d4c6812 100644 --- a/samples/client/petstore/java/jersey2/docs/Tag.md +++ b/samples/client/petstore/java/jersey2/docs/Tag.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2/docs/User.md b/samples/client/petstore/java/jersey2/docs/User.md index 8b6753dd284..cf7f9ce1312 100644 --- a/samples/client/petstore/java/jersey2/docs/User.md +++ b/samples/client/petstore/java/jersey2/docs/User.md @@ -15,3 +15,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2/docs/UserApi.md b/samples/client/petstore/java/jersey2/docs/UserApi.md index 2e6987951c8..e421376ce79 100644 --- a/samples/client/petstore/java/jersey2/docs/UserApi.md +++ b/samples/client/petstore/java/jersey2/docs/UserApi.md @@ -14,9 +14,11 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + # **createUser** -> createUser(body) +> createUser(user) Create user @@ -29,10 +31,13 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object + +User 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 +48,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](.md)| Created user object | + ### Return type @@ -55,8 +61,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithArrayInput** @@ -64,8 +71,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -73,8 +78,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -89,6 +97,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type null (empty response body) @@ -99,8 +108,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithListInput** @@ -108,8 +118,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -117,8 +125,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { @@ -133,6 +144,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type null (empty response body) @@ -143,8 +155,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **deleteUser** @@ -161,8 +174,11 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be deleted + +String username = Arrays.asList("username_example"); // String | The name that needs to be deleted + try { apiInstance.deleteUser(username); } catch (ApiException e) { @@ -175,7 +191,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | + **username** | [**String**](.md)| The name that needs to be deleted | + ### Return type @@ -188,7 +205,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getUserByName** @@ -196,8 +214,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -205,8 +221,11 @@ Get user by user name //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. + +String username = Arrays.asList("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 +239,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + **username** | [**String**](.md)| The name that needs to be fetched. Use user1 for testing. | + ### Return type @@ -235,14 +255,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **loginUser** > String loginUser(username, password) Logs user into the system - - ### Example ```java // Import classes: @@ -250,9 +269,13 @@ Logs user into the system //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 + +String username = Arrays.asList("username_example"); // String | The user name for login + +String password = Arrays.asList("password_example"); // String | The password for login in clear text + try { String result = apiInstance.loginUser(username, password); System.out.println(result); @@ -266,8 +289,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | + **username** | [**String**](.md)| The user name for login | + **password** | [**String**](.md)| The password for login in clear text | + ### Return type @@ -282,14 +306,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **logoutUser** > logoutUser() Logs out current logged in user session - - ### Example ```java // Import classes: @@ -297,7 +320,9 @@ Logs out current logged in user session //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); + try { apiInstance.logoutUser(); } catch (ApiException e) { @@ -309,6 +334,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type null (empty response body) @@ -320,11 +346,12 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updateUser** -> updateUser(username, body) +> updateUser(user, username) Updated user @@ -337,11 +364,15 @@ This can only be done by the logged in user. //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 + +User user = ; // User | Updated user object + +String username = Arrays.asList("username_example"); // String | name that need to be deleted + try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(user, username); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -352,8 +383,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](.md)| Updated user object | + **username** | [**String**](.md)| name that need to be deleted | + ### Return type @@ -365,6 +397,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + + diff --git a/samples/client/petstore/java/jersey2/git_push.sh b/samples/client/petstore/java/jersey2/git_push.sh index ae01b182ae9..ed374619b13 100644 --- a/samples/client/petstore/java/jersey2/git_push.sh +++ b/samples/client/petstore/java/jersey2/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 credential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential 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/jersey2/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/jersey2/gradle/wrapper/gradle-wrapper.jar index 2c6137b8789..e69de29bb2d 100644 Binary files a/samples/client/petstore/java/jersey2/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/jersey2/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/jersey2/pom.xml b/samples/client/petstore/java/jersey2/pom.xml index 7528ca32ec5..a0d224a4b0e 100644 --- a/samples/client/petstore/java/jersey2/pom.xml +++ b/samples/client/petstore/java/jersey2/pom.xml @@ -1,266 +1,260 @@ - 4.0.0 - io.swagger - swagger-petstore-jersey2 - jar - swagger-petstore-jersey2 - 1.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-petstore-jersey2 + jar + swagger-petstore-jersey2 + 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 - 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 + - - - 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 - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - 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-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.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + jar + test-jar + + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - - - 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.7 - 1.7 - - - - 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 - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + + + 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.7 + 1.7 + + + + + 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 - - - - - - - - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + - - - io.swagger - swagger-annotations - ${swagger-core-version} - + + + io.swagger + swagger-annotations + ${swagger-core-version} + - - - org.glassfish.jersey.core - jersey-client - ${jersey-version} - - - org.glassfish.jersey.media - jersey-media-multipart - ${jersey-version} - - - org.glassfish.jersey.media - jersey-media-json-jackson - ${jersey-version} - + + + org.glassfish.jersey.core + jersey-client + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-multipart + ${jersey-version} + + + org.glassfish.jersey.media + jersey-media-json-jackson + ${jersey-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.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-version} - - - - com.brsanthu - migbase64 - 2.2 - - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.5.15 - 2.25.1 - 2.6.4 - 1.0.0 - 4.12 - + + + 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.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-version} + + + + + + com.brsanthu + migbase64 + 2.2 + + + + + + + junit + junit + ${junit-version} + test + + + + 1.5.15 + + 2.25.1 + + + 2.6.4 + 1.0.0 + 4.12 + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/ApiClient.java index b7341098733..cf1a2f6d5de 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/ApiClient.java @@ -15,6 +15,7 @@ import org.glassfish.jersey.client.ClientProperties; import org.glassfish.jersey.client.HttpUrlConnectorProvider; import org.glassfish.jersey.jackson.JacksonFeature; +import org.glassfish.jersey.logging.LoggingFeature; import org.glassfish.jersey.media.multipart.FormDataBodyPart; import org.glassfish.jersey.media.multipart.FormDataContentDisposition; import org.glassfish.jersey.media.multipart.MultiPart; @@ -23,9 +24,11 @@ import java.io.IOException; import java.io.InputStream; + import java.nio.file.Files; import java.nio.file.StandardCopyOption; -import org.glassfish.jersey.logging.LoggingFeature; + + import java.util.Collection; import java.util.Collections; import java.util.Map; @@ -56,7 +59,6 @@ public class ApiClient { protected String basePath = "http://petstore.swagger.io:80/v2"; protected boolean debugging = false; protected int connectionTimeout = 0; - private int readTimeout = 0; protected Client httpClient; protected JSON json; @@ -303,27 +305,6 @@ public ApiClient setConnectTimeout(int connectionTimeout) { return this; } - /** - * read timeout (in milliseconds). - * @return Read timeout - */ - public int getReadTimeout() { - return readTimeout; - } - - /** - * Set the read timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link Integer#MAX_VALUE}. - * @param readTimeout Read timeout in milliseconds - * @return API client - */ - public ApiClient setReadTimeout(int readTimeout) { - this.readTimeout = readTimeout; - httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout); - return this; - } - /** * Get the date format used to parse/format date parameters. * @return Date format @@ -586,6 +567,8 @@ public T deserialize(Response response, GenericType returnType) throws Ap List contentTypes = response.getHeaders().get("Content-Type"); if (contentTypes != null && !contentTypes.isEmpty()) contentType = String.valueOf(contentTypes.get(0)); + if (contentType == null) + throw new ApiException(500, "missing Content-Type in response"); return response.readEntity(returnType); } @@ -599,7 +582,10 @@ public T deserialize(Response response, GenericType returnType) throws Ap public File downloadFileFromResponse(Response response) throws ApiException { try { File file = prepareDownloadFile(response); + Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING); + + return file; } catch (IOException e) { throw new ApiException(e); diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/JSON.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/JSON.java index 433f1a313e1..065b1437689 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/JSON.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/JSON.java @@ -1,10 +1,16 @@ package io.swagger.client; + import org.threeten.bp.*; + import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; + + + import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; + import java.text.DateFormat; import javax.ws.rs.ext.ContextResolver; @@ -22,11 +28,15 @@ public JSON() { mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.setDateFormat(new RFC3339DateFormat()); + + + 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); + } /** 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 494f81b84d2..41c44e53e34 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 @@ -9,12 +9,16 @@ import io.swagger.client.model.Client; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class AnotherFakeApi { private ApiClient apiClient; @@ -34,19 +38,27 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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 @@ -57,9 +69,12 @@ public Client testSpecialTags(Client body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/json" }; @@ -72,7 +87,11 @@ public Client testSpecialTags(Client body) throws ApiException { String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + } + 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 2980f8bb1fa..a10cd5ef785 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 @@ -9,16 +9,18 @@ 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 java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class FakeApi { private ApiClient apiClient; @@ -38,13 +40,21 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * * Test serialization of outer boolean types + * @param body 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; @@ -56,33 +66,46 @@ public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * * 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"; @@ -92,31 +115,44 @@ public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Ap Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * * Test serialization of outer number types + * @param body Input number as post body (optional) + + * @return BigDecimal + * @throws ApiException if fails to make API call + + */ + public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException { Object localVarPostBody = body; @@ -128,31 +164,44 @@ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * * Test serialization of outer string types + * @param body Input string as post body (optional) + + * @return String + * @throws ApiException if fails to make API call + + */ + public String fakeOuterStringSerialize(String body) throws ApiException { Object localVarPostBody = body; @@ -164,37 +213,50 @@ public String fakeOuterStringSerialize(String body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * 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 @@ -205,9 +267,12 @@ public Client testClientModel(Client body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/json" }; @@ -220,49 +285,30 @@ public Client testClientModel(Client body) throws ApiException { String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) + + * @param body (required) + + * @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 { - Object localVarPostBody = null; - - // verify the required parameter 'number' is set - if (number == null) { - throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters"); - } - - // verify the required parameter '_double' is set - if (_double == null) { - throw new ApiException(400, "Missing the required parameter '_double' when calling testEndpointParameters"); - } - - // verify the required parameter 'patternWithoutDelimiter' is set - if (patternWithoutDelimiter == null) { - throw new ApiException(400, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); - } + + public void testEndpointParameters(Object body) throws ApiException { + Object localVarPostBody = body; - // verify the required parameter '_byte' is set - if (_byte == null) { - throw new ApiException(400, "Missing the required parameter '_byte' when calling testEndpointParameters"); + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testEndpointParameters"); } // create path and map variables @@ -273,39 +319,14 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + - if (integer != null) - localVarFormParams.put("integer", integer); -if (int32 != null) - localVarFormParams.put("int32", int32); -if (int64 != null) - localVarFormParams.put("int64", int64); -if (number != null) - localVarFormParams.put("number", number); -if (_float != null) - localVarFormParams.put("float", _float); -if (_double != null) - localVarFormParams.put("double", _double); -if (string != null) - localVarFormParams.put("string", string); -if (patternWithoutDelimiter != null) - localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter); -if (_byte != null) - localVarFormParams.put("byte", _byte); -if (binary != null) - localVarFormParams.put("binary", binary); -if (date != null) - localVarFormParams.put("date", date); -if (dateTime != null) - localVarFormParams.put("dateTime", dateTime); -if (password != null) - localVarFormParams.put("password", password); -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); @@ -316,24 +337,35 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat String[] localVarAuthNames = new String[] { "http_basic_test" }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, 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 body (optional) + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + + * @param enumHeaderString Header parameter enum test (string) (optional) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + + * @param enumQueryString Query parameter enum test (string) (optional) + * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (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 { - Object localVarPostBody = null; + + public void testEnumParameters(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger) throws ApiException { + Object localVarPostBody = body; // create path and map variables String localVarPath = "/fake"; @@ -343,24 +375,24 @@ public void testEnumParameters(List enumFormStringArray, String enumForm Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray)); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string_array", enumQueryStringArray)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger)); + if (enumHeaderStringArray != null) localVarHeaderParams.put("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); -if (enumHeaderString != null) + if (enumHeaderString != null) localVarHeaderParams.put("enum_header_string", apiClient.parameterToString(enumHeaderString)); + - 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); + final String[] localVarAccepts = { - "*/*" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -371,21 +403,29 @@ public void testEnumParameters(List enumFormStringArray, String enumForm String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * test inline additionalProperties * - * @param param request body (required) + + * @param body request body (required) + + * @throws ApiException if fails to make API call + + */ - public void testInlineAdditionalProperties(Object param) throws ApiException { - Object localVarPostBody = param; + + public void testInlineAdditionalProperties(Map body) throws ApiException { + Object localVarPostBody = body; - // 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 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testInlineAdditionalProperties"); } // create path and map variables @@ -396,9 +436,12 @@ public void testInlineAdditionalProperties(Object param) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { }; @@ -411,27 +454,29 @@ public void testInlineAdditionalProperties(Object param) throws ApiException { String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * test json serialization of form data * - * @param param field1 (required) - * @param param2 field2 (required) + + * @param body (required) + + * @throws ApiException if fails to make API call + + */ - public void testJsonFormData(String param, String param2) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'param' is set - if (param == null) { - throw new ApiException(400, "Missing the required parameter 'param' when calling testJsonFormData"); - } + + public void testJsonFormData(Object body) throws ApiException { + Object localVarPostBody = body; - // verify the required parameter 'param2' is set - if (param2 == null) { - throw new ApiException(400, "Missing the required parameter 'param2' when calling testJsonFormData"); + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testJsonFormData"); } // create path and map variables @@ -442,12 +487,11 @@ public void testJsonFormData(String param, String param2) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + - if (param != null) - localVarFormParams.put("param", param); -if (param2 != null) - localVarFormParams.put("param2", param2); final String[] localVarAccepts = { @@ -461,7 +505,10 @@ public void testJsonFormData(String param, String param2) throws ApiException { String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + } + 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 41b78ca6524..9a1e8f9acb9 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 @@ -9,12 +9,16 @@ import io.swagger.client.model.Client; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class FakeClassnameTags123Api { private ApiClient apiClient; @@ -34,19 +38,27 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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 @@ -57,9 +69,12 @@ public Client testClassname(Client body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/json" }; @@ -72,7 +87,11 @@ public Client testClassname(Client body) throws ApiException { String[] localVarAuthNames = new String[] { "api_key_query" }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + } + 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 6af9763779c..8621d0703ac 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 @@ -7,16 +7,19 @@ import javax.ws.rs.core.GenericType; -import java.io.File; import io.swagger.client.model.ModelApiResponse; import io.swagger.client.model.Pet; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class PetApi { private ApiClient apiClient; @@ -36,18 +39,25 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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 @@ -58,11 +68,14 @@ public void addPet(Pet body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -73,17 +86,26 @@ public void addPet(Pet body) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Deletes a pet * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + + * @throws ApiException if fails to make API call + + */ - public void deletePet(Long petId, String apiKey) throws ApiException { + + public void deletePet(Integer petId, String apiKey) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'petId' is set @@ -100,13 +122,16 @@ public void deletePet(Long petId, String apiKey) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (apiKey != null) localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey)); + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -117,16 +142,25 @@ public void deletePet(Long petId, String apiKey) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; - + apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + + * @return List<Pet> + * @throws ApiException if fails to make API call + + */ + public List findPetsByStatus(List status) throws ApiException { Object localVarPostBody = null; @@ -143,10 +177,14 @@ public List findPetsByStatus(List status) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status)); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status)); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -159,18 +197,28 @@ public List findPetsByStatus(List status) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; + GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + + * @return List<Pet> + * @throws ApiException if fails to make API call * @deprecated + + */ @Deprecated + public List findPetsByTags(List tags) throws ApiException { Object localVarPostBody = null; @@ -187,10 +235,14 @@ public List findPetsByTags(List tags) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags)); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "tags", tags)); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -203,17 +255,27 @@ public List findPetsByTags(List tags) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; + GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * Find pet by ID * Returns a single pet + * @param petId ID of pet to return (required) + + * @return Pet + * @throws ApiException if fails to make API call + + */ - public Pet getPetById(Long petId) throws ApiException { + + public Pet getPetById(Integer petId) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'petId' is set @@ -230,9 +292,12 @@ public Pet getPetById(Long petId) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -245,21 +310,30 @@ public Pet getPetById(Long petId) throws ApiException { String[] localVarAuthNames = new String[] { "api_key" }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * 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 @@ -270,11 +344,14 @@ public void updatePet(Pet body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -285,19 +362,27 @@ public void updatePet(Pet body) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; - + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Updates a pet in the store with form data * + * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) + + * @param body (optional) + + * @throws ApiException if fails to make API call + + */ - public void updatePetWithForm(Long petId, String name, String status) throws ApiException { - Object localVarPostBody = null; + + public void updatePetWithForm(Integer petId, Object body) throws ApiException { + Object localVarPostBody = body; // verify the required parameter 'petId' is set if (petId == null) { @@ -313,15 +398,14 @@ public void updatePetWithForm(Long petId, String name, String status) throws Api Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + - if (name != null) - localVarFormParams.put("name", name); -if (status != null) - localVarFormParams.put("status", status); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -332,20 +416,29 @@ public void updatePetWithForm(Long petId, String name, String status) throws Api String[] localVarAuthNames = new String[] { "petstore_auth" }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * uploads an image * + * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) + + * @param body (optional) + + * @return ModelApiResponse + * @throws ApiException if fails to make API call + + */ - public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException { - Object localVarPostBody = null; + + public ModelApiResponse uploadFile(Integer petId, Object body) throws ApiException { + Object localVarPostBody = body; // verify the required parameter 'petId' is set if (petId == null) { @@ -361,12 +454,11 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + - if (additionalMetadata != null) - localVarFormParams.put("additionalMetadata", additionalMetadata); -if (file != null) - localVarFormParams.put("file", file); final String[] localVarAccepts = { "application/json" @@ -380,7 +472,11 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f String[] localVarAuthNames = new String[] { "petstore_auth" }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + } + 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 22be0ebb027..32c0564e1c5 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 @@ -9,12 +9,16 @@ import io.swagger.client.model.Order; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class StoreApi { private ApiClient apiClient; @@ -34,12 +38,19 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + + * @throws ApiException if fails to make API call + + */ + public void deleteOrder(String orderId) throws ApiException { Object localVarPostBody = null; @@ -57,11 +68,14 @@ public void deleteOrder(String orderId) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -72,15 +86,23 @@ public void deleteOrder(String orderId) throws ApiException { String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Returns pet inventories by status * Returns a map of status codes to quantities + + * @return Map<String, Integer> + * @throws ApiException if fails to make API call + + */ + public Map getInventory() throws ApiException { Object localVarPostBody = null; @@ -92,9 +114,12 @@ public Map getInventory() throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/json" }; @@ -107,17 +132,27 @@ public Map getInventory() throws ApiException { String[] localVarAuthNames = new String[] { "api_key" }; + GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + + * @return Order + * @throws ApiException if fails to make API call + + */ - public Order getOrderById(Long orderId) throws ApiException { + + public Order getOrderById(Integer orderId) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'orderId' is set @@ -134,9 +169,12 @@ public Order getOrderById(Long orderId) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -149,22 +187,32 @@ public Order getOrderById(Long orderId) throws ApiException { String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * 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 @@ -175,22 +223,29 @@ public Order placeOrder(Order body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + } + 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 a7dced63d85..8b966c3c71d 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 @@ -9,12 +9,16 @@ import io.swagger.client.model.User; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class UserApi { private ApiClient apiClient; @@ -34,18 +38,25 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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 @@ -56,30 +67,41 @@ public void createUser(User body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Creates list of users with given input array * + * @param body List of user object (required) + + * @throws ApiException if fails to make API call + + */ + public void createUsersWithArrayInput(List body) throws ApiException { Object localVarPostBody = body; @@ -96,30 +118,41 @@ public void createUsersWithArrayInput(List body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Creates list of users with given input array * + * @param body List of user object (required) + + * @throws ApiException if fails to make API call + + */ + public void createUsersWithListInput(List body) throws ApiException { Object localVarPostBody = body; @@ -136,30 +169,41 @@ public void createUsersWithListInput(List body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Delete user * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + + * @throws ApiException if fails to make API call + + */ + public void deleteUser(String username) throws ApiException { Object localVarPostBody = null; @@ -177,11 +221,14 @@ public void deleteUser(String username) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -192,16 +239,25 @@ public void deleteUser(String username) throws ApiException { String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Get user by user name * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + + * @return User + * @throws ApiException if fails to make API call + + */ + public User getUserByName(String username) throws ApiException { Object localVarPostBody = null; @@ -219,9 +275,12 @@ public User getUserByName(String username) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -234,17 +293,28 @@ public User getUserByName(String username) throws ApiException { String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * Logs user into the system * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + + * @return String + * @throws ApiException if fails to make API call + + */ + public String loginUser(String username, String password) throws ApiException { Object localVarPostBody = null; @@ -266,11 +336,16 @@ public String loginUser(String username, String password) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "password", password)); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -283,14 +358,22 @@ public String loginUser(String username, String password) throws ApiException { String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * Logs out current logged in user session * + + * @throws ApiException if fails to make API call + + */ + public void logoutUser() throws ApiException { Object localVarPostBody = null; @@ -302,11 +385,14 @@ public void logoutUser() throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -317,29 +403,38 @@ public void logoutUser() throws ApiException { String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Updated user * This can only be done by the logged in user. + + * @param user Updated user object (required) + * @param username name that need to be deleted (required) - * @param body 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(User user, String username) throws ApiException { + Object localVarPostBody = user; + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser"); + } // 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"); - } - // create path and map variables String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); @@ -349,22 +444,28 @@ public void updateUser(String username, User body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + } + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/auth/HttpBasicAuth.java index 788b63a9918..44f4f86e490 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/auth/HttpBasicAuth.java @@ -15,14 +15,19 @@ import io.swagger.client.Pair; + import com.migcomponents.migbase64.Base64; + + import java.util.Map; import java.util.List; + import java.io.UnsupportedEncodingException; + public class HttpBasicAuth implements Authentication { private String username; private String password; @@ -49,10 +54,13 @@ public void applyToParams(List queryParams, Map headerPara return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + try { headerParams.put("Authorization", "Basic " + Base64.encodeToString(str.getBytes("UTF-8"), false)); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } + + } } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 7fe69e168fd..c226acf8619 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -28,65 +28,65 @@ */ public class AdditionalPropertiesClass { + @JsonProperty("map_property") private Map mapProperty = null; - + @JsonProperty("map_of_map_property") private Map> mapOfMapProperty = null; - + public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; return this; } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { this.mapProperty = new HashMap(); } + this.mapProperty.put(key, mapPropertyItem); return this; } - - /** - * Get mapProperty - * @return mapProperty + /** + * Get mapProperty + * @return mapProperty **/ @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } - public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } - + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; return this; } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { this.mapOfMapProperty = new HashMap>(); } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } - - /** - * Get mapOfMapProperty - * @return mapOfMapProperty + /** + * Get mapOfMapProperty + * @return mapOfMapProperty **/ @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -104,8 +104,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapProperty, mapOfMapProperty); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -128,5 +127,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Animal.java index 590f36c0ae0..ddd1f98533f 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Animal.java @@ -25,56 +25,60 @@ /** * Animal */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true ) + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Discriminator{propertyName='className', mapping=null}", visible = true ) @JsonSubTypes({ + @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + }) public class Animal { + @JsonProperty("className") private String className = null; - + @JsonProperty("color") private String color = "red"; - + public Animal className(String className) { this.className = className; return this; } - /** - * Get className - * @return className + + /** + * Get className + * @return className **/ @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } - public void setClassName(String className) { this.className = className; } - + public Animal color(String color) { this.color = color; return this; } - /** - * Get color - * @return color + + /** + * Get color + * @return color **/ @ApiModelProperty(value = "") public String getColor() { return color; } - public void setColor(String color) { this.color = color; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -92,8 +96,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(className, color); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -116,5 +119,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AnimalFarm.java deleted file mode 100644 index 0b1d6a74cc6..00000000000 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/AnimalFarm.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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 io.swagger.client.model.Animal; -import java.util.ArrayList; -import java.util.List; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index b7e59a030a4..380b98b1f70 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -28,36 +28,37 @@ */ public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") private List> arrayArrayNumber = null; - + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; return this; } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { this.arrayArrayNumber = new ArrayList>(); } + this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber **/ @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } - public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,8 +75,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayArrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -97,5 +97,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index fdfeb6856f3..482a3177a15 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -28,36 +28,37 @@ */ public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") private List arrayNumber = null; - + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; return this; } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { this.arrayNumber = new ArrayList(); } + this.arrayNumber.add(arrayNumberItem); return this; } - - /** - * Get arrayNumber - * @return arrayNumber + + /** + * Get arrayNumber + * @return arrayNumber **/ @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } - public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,8 +75,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -97,5 +97,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayTest.java index 62665c2536a..e70233c3c7f 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ArrayTest.java @@ -28,94 +28,97 @@ */ public class ArrayTest { + @JsonProperty("array_of_string") private List arrayOfString = null; - + @JsonProperty("array_array_of_integer") private List> arrayArrayOfInteger = null; - + @JsonProperty("array_array_of_model") private List> arrayArrayOfModel = null; - + public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; return this; } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { this.arrayOfString = new ArrayList(); } + this.arrayOfString.add(arrayOfStringItem); return this; } - - /** - * Get arrayOfString - * @return arrayOfString + + /** + * Get arrayOfString + * @return arrayOfString **/ @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } - public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } - + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { this.arrayArrayOfInteger = new ArrayList>(); } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger **/ @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } - + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { this.arrayArrayOfModel = new ArrayList>(); } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel **/ @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } - public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -134,8 +137,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -159,5 +161,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Capitalization.java index a72b0a72f46..f534657b4ca 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Capitalization.java @@ -25,133 +25,133 @@ */ public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel = null; - + @JsonProperty("CapitalCamel") private String capitalCamel = null; - + @JsonProperty("small_Snake") private String smallSnake = null; - + @JsonProperty("Capital_Snake") private String capitalSnake = null; - + @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints = null; - + @JsonProperty("ATT_NAME") private String ATT_NAME = null; - + public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; return this; } - /** - * Get smallCamel - * @return smallCamel + + /** + * Get smallCamel + * @return smallCamel **/ @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } - public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } - + public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; return this; } - /** - * Get capitalCamel - * @return capitalCamel + + /** + * Get capitalCamel + * @return capitalCamel **/ @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } - public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } - + public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; return this; } - /** - * Get smallSnake - * @return smallSnake + + /** + * Get smallSnake + * @return smallSnake **/ @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } - public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } - + public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; return this; } - /** - * Get capitalSnake - * @return capitalSnake + + /** + * Get capitalSnake + * @return capitalSnake **/ @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } - public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } - + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; return this; } - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints **/ @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } - public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } - + public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; return this; } - /** - * Name of the pet - * @return ATT_NAME + + /** + * Name of the pet + * @return ATT_NAME **/ @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } - public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -173,8 +173,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -201,5 +200,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java index b882da0ad90..d6e94912f06 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Cat.java @@ -26,28 +26,70 @@ */ public class Cat extends Animal { + + @JsonProperty("className") + private String className = null; + + @JsonProperty("color") + private String color = "red"; + @JsonProperty("declawed") private Boolean declawed = null; + + public Cat className(String className) { + this.className = className; + return this; + } + + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Cat color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; } - /** - * Get declawed - * @return declawed + + /** + * Get declawed + * @return declawed **/ @ApiModelProperty(value = "") public Boolean isDeclawed() { return declawed; } - public void setDeclawed(Boolean declawed) { this.declawed = declawed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -57,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && + return Objects.equals(this.className, cat.className) && + Objects.equals(this.color, cat.color) && + Objects.equals(this.declawed, cat.declawed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(declawed, super.hashCode()); + return Objects.hash(className, color, declawed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); sb.append("}"); return sb.toString(); @@ -88,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Category.java index 464f4375c4b..5ef89bf53cf 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Category.java @@ -25,49 +25,49 @@ */ public class Category { + @JsonProperty("id") private Long id = null; - + @JsonProperty("name") private String name = null; - + public Category id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Category name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -85,8 +85,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -109,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ClassModel.java index 4f764fde68d..887733b7310 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ClassModel.java @@ -22,32 +22,31 @@ /** * Model for testing model with \"_class\" property - */ -@ApiModel(description = "Model for testing model with \"_class\" property") + */@ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { + @JsonProperty("_class") private String propertyClass = null; - + public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,8 +63,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -87,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Client.java index a7c4253499c..6193700c6ca 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Client.java @@ -25,28 +25,28 @@ */ public class Client { + @JsonProperty("client") private String client = null; - + public Client client(String client) { this.client = client; return this; } - /** - * Get client - * @return client + + /** + * Get client + * @return client **/ @ApiModelProperty(value = "") public String getClient() { return client; } - public void setClient(String client) { this.client = client; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,8 +63,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(client); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -86,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Dog.java index 7de179b2ade..bffa0917362 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Dog.java @@ -26,28 +26,70 @@ */ public class Dog extends Animal { + + @JsonProperty("className") + private String className = null; + + @JsonProperty("color") + private String color = "red"; + @JsonProperty("breed") private String breed = null; + + public Dog className(String className) { + this.className = className; + return this; + } + + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Dog color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Dog breed(String breed) { this.breed = breed; return this; } - /** - * Get breed - * @return breed + + /** + * Get breed + * @return breed **/ @ApiModelProperty(value = "") public String getBreed() { return breed; } - public void setBreed(String breed) { this.breed = breed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -57,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && + return Objects.equals(this.className, dog.className) && + Objects.equals(this.color, dog.color) && + Objects.equals(this.breed, dog.breed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(breed, super.hashCode()); + return Objects.hash(className, color, breed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); sb.append("}"); return sb.toString(); @@ -88,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java index 12caa480285..e23a220e753 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java @@ -27,12 +27,13 @@ */ public class EnumArrays { - /** + + /** * Gets or Sets justSymbol */ public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), + GREATER_THAN_OR_EQUAL_TO(">="), DOLLAR("$"); private String value; @@ -40,8 +41,9 @@ public enum JustSymbolEnum { JustSymbolEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -50,8 +52,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static JustSymbolEnum fromValue(String text) { for (JustSymbolEnum b : JustSymbolEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -60,17 +63,20 @@ public static JustSymbolEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("just_symbol") private JustSymbolEnum justSymbol = null; - - /** + + + /** * Gets or Sets arrayEnum */ public enum ArrayEnumEnum { - FISH("fish"), + FISH("fish"), CRAB("crab"); private String value; @@ -78,8 +84,9 @@ public enum ArrayEnumEnum { ArrayEnumEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -88,8 +95,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static ArrayEnumEnum fromValue(String text) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -98,56 +106,57 @@ public static ArrayEnumEnum fromValue(String text) { } return null; } + } - + @JsonProperty("array_enum") private List arrayEnum = null; - + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; return this; } - /** - * Get justSymbol - * @return justSymbol + + /** + * Get justSymbol + * @return justSymbol **/ @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } - public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } - + public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; return this; } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { this.arrayEnum = new ArrayList(); } + this.arrayEnum.add(arrayEnumItem); return this; } - - /** - * Get arrayEnum - * @return arrayEnum + + /** + * Get arrayEnum + * @return arrayEnum **/ @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } - public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -165,8 +174,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -189,5 +197,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumClass.java index abbd7a56668..9414211ef6c 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumClass.java @@ -13,14 +13,17 @@ package io.swagger.client.model; -import java.util.Objects; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + + /** * Gets or Sets EnumClass */ + public enum EnumClass { _ABC("_abc"), @@ -35,7 +38,9 @@ public enum EnumClass { this.value = value; } + @JsonValue + public String getValue() { return value; } @@ -45,7 +50,9 @@ public String toString() { return String.valueOf(value); } + @JsonCreator + public static EnumClass fromValue(String text) { for (EnumClass b : EnumClass.values()) { if (String.valueOf(b.value).equals(text)) { @@ -54,5 +61,8 @@ public static EnumClass fromValue(String text) { } return null; } + } + + 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 93d0da037b6..4634e7018db 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 @@ -26,14 +26,14 @@ */ public class EnumTest { - /** + + /** * Gets or Sets enumString */ public enum EnumStringEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"), - EMPTY(""); private String value; @@ -41,8 +41,9 @@ public enum EnumStringEnum { EnumStringEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -51,8 +52,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumStringEnum fromValue(String text) { for (EnumStringEnum b : EnumStringEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -61,17 +63,19 @@ public static EnumStringEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_string") private EnumStringEnum enumString = null; - - /** + + /** * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(1), NUMBER_MINUS_1(-1); private Integer value; @@ -79,8 +83,9 @@ public enum EnumIntegerEnum { EnumIntegerEnum(Integer value) { this.value = value; } - + @JsonValue + public Integer getValue() { return value; } @@ -89,8 +94,9 @@ public Integer getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumIntegerEnum fromValue(String text) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -99,17 +105,19 @@ public static EnumIntegerEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger = null; - - /** + + /** * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(1.1), NUMBER_MINUS_1_DOT_2(-1.2); private Double value; @@ -117,8 +125,9 @@ public enum EnumNumberEnum { EnumNumberEnum(Double value) { this.value = value; } - + @JsonValue + public Double getValue() { return value; } @@ -127,8 +136,9 @@ public Double getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumNumberEnum fromValue(String text) { for (EnumNumberEnum b : EnumNumberEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -137,87 +147,88 @@ public static EnumNumberEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_number") private EnumNumberEnum enumNumber = null; - + @JsonProperty("outerEnum") private OuterEnum outerEnum = null; - + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; } - /** - * Get enumString - * @return enumString + + /** + * Get enumString + * @return enumString **/ @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } - public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } - + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; } - /** - * Get enumInteger - * @return enumInteger + + /** + * Get enumInteger + * @return enumInteger **/ @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } - public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } - + public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; return this; } - /** - * Get enumNumber - * @return enumNumber + + /** + * Get enumNumber + * @return enumNumber **/ @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } - public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - + public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; return this; } - /** - * Get outerEnum - * @return outerEnum + + /** + * Get outerEnum + * @return outerEnum **/ @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -237,8 +248,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -263,5 +273,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\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 4118656d29e..df02f3998d4 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 @@ -29,290 +29,284 @@ */ public class FormatTest { + @JsonProperty("integer") private Integer integer = null; - + @JsonProperty("int32") private Integer int32 = null; - + @JsonProperty("int64") private Long int64 = null; - + @JsonProperty("number") private BigDecimal number = null; - + @JsonProperty("float") private Float _float = null; - + @JsonProperty("double") private Double _double = null; - + @JsonProperty("string") private String string = null; - + @JsonProperty("byte") - private byte[] _byte = null; - + private String _byte = null; + @JsonProperty("binary") - private byte[] binary = null; - + private String binary = null; + @JsonProperty("date") private LocalDate date = null; - + @JsonProperty("dateTime") private OffsetDateTime dateTime = null; - + @JsonProperty("uuid") private UUID uuid = null; - + @JsonProperty("password") private String password = null; - + public FormatTest integer(Integer integer) { this.integer = integer; return this; } - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer **/ @ApiModelProperty(value = "") public Integer getInteger() { return integer; } - public void setInteger(Integer integer) { this.integer = integer; } - + public FormatTest int32(Integer int32) { this.int32 = int32; return this; } - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 **/ @ApiModelProperty(value = "") public Integer getInt32() { return int32; } - public void setInt32(Integer int32) { this.int32 = int32; } - + public FormatTest int64(Long int64) { this.int64 = int64; return this; } - /** - * Get int64 - * @return int64 + + /** + * Get int64 + * @return int64 **/ @ApiModelProperty(value = "") public Long getInt64() { return int64; } - public void setInt64(Long int64) { this.int64 = int64; } - + public FormatTest number(BigDecimal number) { this.number = number; return this; } - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number + + /** + * Get number + * @return number **/ @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } - public void setNumber(BigDecimal number) { this.number = number; } - + public FormatTest _float(Float _float) { this._float = _float; return this; } - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float + + /** + * Get _float + * @return _float **/ @ApiModelProperty(value = "") public Float getFloat() { return _float; } - public void setFloat(Float _float) { this._float = _float; } - + public FormatTest _double(Double _double) { this._double = _double; return this; } - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double + + /** + * Get _double + * @return _double **/ @ApiModelProperty(value = "") public Double getDouble() { return _double; } - public void setDouble(Double _double) { this._double = _double; } - + public FormatTest string(String string) { this.string = string; return this; } - /** - * Get string - * @return string + + /** + * Get string + * @return string **/ @ApiModelProperty(value = "") public String getString() { return string; } - public void setString(String string) { this.string = string; } - - public FormatTest _byte(byte[] _byte) { + + public FormatTest _byte(String _byte) { this._byte = _byte; return this; } - /** - * Get _byte - * @return _byte + + /** + * Get _byte + * @return _byte **/ @ApiModelProperty(required = true, value = "") - public byte[] getByte() { + public String getByte() { return _byte; } - - public void setByte(byte[] _byte) { + public void setByte(String _byte) { this._byte = _byte; } - - public FormatTest binary(byte[] binary) { + + public FormatTest binary(String binary) { this.binary = binary; return this; } - /** - * Get binary - * @return binary + + /** + * Get binary + * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public String getBinary() { return binary; } - - public void setBinary(byte[] binary) { + public void setBinary(String binary) { this.binary = binary; } - + public FormatTest date(LocalDate date) { this.date = date; return this; } - /** - * Get date - * @return date + + /** + * Get date + * @return date **/ @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } - public void setDate(LocalDate date) { this.date = date; } - + public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public FormatTest password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -341,8 +335,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -376,5 +369,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 6dc9f12c4b8..98a721fb9dc 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -25,31 +25,33 @@ */ public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar = null; - + @JsonProperty("foo") private String foo = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - - /** - * Get foo - * @return foo + + + /** + * Get foo + * @return foo **/ @ApiModelProperty(value = "") public String getFoo() { return foo; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,8 +69,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, foo); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -91,5 +92,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java index e6344a1df0f..90ed39f7e3f 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java @@ -28,15 +28,17 @@ */ public class MapTest { + @JsonProperty("map_map_of_string") private Map> mapMapOfString = null; - - /** + + + /** * Gets or Sets inner */ public enum InnerEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"); private String value; @@ -44,8 +46,9 @@ public enum InnerEnum { InnerEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -54,8 +57,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static InnerEnum fromValue(String text) { for (InnerEnum b : InnerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -64,64 +68,64 @@ public static InnerEnum fromValue(String text) { } return null; } + } - + @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; - + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { this.mapMapOfString = new HashMap>(); } + this.mapMapOfString.put(key, mapMapOfStringItem); return this; } - - /** - * Get mapMapOfString - * @return mapMapOfString + /** + * Get mapMapOfString + * @return mapMapOfString **/ @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } - public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } - + public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; return this; } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { this.mapOfEnumString = new HashMap(); } + this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } - - /** - * Get mapOfEnumString - * @return mapOfEnumString + /** + * Get mapOfEnumString + * @return mapOfEnumString **/ @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } - public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -139,8 +143,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -163,5 +166,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 29bfc7e8c08..4a8b69780fd 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -31,78 +31,78 @@ */ public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid = null; - + @JsonProperty("dateTime") private OffsetDateTime dateTime = null; - + @JsonProperty("map") private Map map = null; - + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; return this; } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { this.map = new HashMap(); } + this.map.put(key, mapItem); return this; } - - /** - * Get map - * @return map + /** + * Get map + * @return map **/ @ApiModelProperty(value = "") public Map getMap() { return map; } - public void setMap(Map map) { this.map = map; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -121,8 +121,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(uuid, dateTime, map); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -146,5 +145,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 58624475e43..606b051c2ea 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 @@ -22,53 +22,52 @@ /** * Model for testing model name starting with number - */ -@ApiModel(description = "Model for testing model name starting with number") + */@ApiModel(description = "Model for testing model name starting with number") public class Model200Response { + @JsonProperty("name") private Integer name = null; - + @JsonProperty("class") private String propertyClass = null; - + public Model200Response name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - + public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -86,8 +85,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -110,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelApiResponse.java index b010e53b48c..4002f3f632e 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -25,70 +25,70 @@ */ public class ModelApiResponse { + @JsonProperty("code") private Integer code = null; - + @JsonProperty("type") private String type = null; - + @JsonProperty("message") private String message = null; - + public ModelApiResponse code(Integer code) { this.code = code; return this; } - /** - * Get code - * @return code + + /** + * Get code + * @return code **/ @ApiModelProperty(value = "") public Integer getCode() { return code; } - public void setCode(Integer code) { this.code = code; } - + public ModelApiResponse type(String type) { this.type = type; return this; } - /** - * Get type - * @return type + + /** + * Get type + * @return type **/ @ApiModelProperty(value = "") public String getType() { return type; } - public void setType(String type) { this.type = type; } - + public ModelApiResponse message(String message) { this.message = message; return this; } - /** - * Get message - * @return message + + /** + * Get message + * @return message **/ @ApiModelProperty(value = "") public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -107,8 +107,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(code, type, message); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -132,5 +131,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelReturn.java index 27d08557248..685e5ba93ac 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelReturn.java @@ -22,32 +22,31 @@ /** * Model for testing reserved words - */ -@ApiModel(description = "Model for testing reserved words") + */@ApiModel(description = "Model for testing reserved words") public class ModelReturn { + @JsonProperty("return") private Integer _return = null; - + public ModelReturn _return(Integer _return) { this._return = _return; return this; } - /** - * Get _return - * @return _return + + /** + * Get _return + * @return _return **/ @ApiModelProperty(value = "") public Integer getReturn() { return _return; } - public void setReturn(Integer _return) { this._return = _return; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,8 +63,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(_return); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -87,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 f2b9b1703bd..7c94ab233c2 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 @@ -22,77 +22,78 @@ /** * Model for testing model name same as property name - */ -@ApiModel(description = "Model for testing model name same as property name") + */@ApiModel(description = "Model for testing model name same as property name") public class Name { + @JsonProperty("name") private Integer name = null; - + @JsonProperty("snake_case") private Integer snakeCase = null; - + @JsonProperty("property") private String property = null; - + @JsonProperty("123Number") private Integer _123Number = null; - + public Name name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - - /** - * Get snakeCase - * @return snakeCase + + + /** + * Get snakeCase + * @return snakeCase **/ @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } - + public Name property(String property) { this.property = property; return this; } - /** - * Get property - * @return property + + /** + * Get property + * @return property **/ @ApiModelProperty(value = "") public String getProperty() { return property; } - public void setProperty(String property) { this.property = property; } - - /** - * Get _123Number - * @return _123Number + + + /** + * Get _123Number + * @return _123Number **/ @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,8 +113,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, snakeCase, property, _123Number); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -138,5 +138,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/NumberOnly.java index ec93aba0531..dc53f9e50dc 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/NumberOnly.java @@ -26,28 +26,28 @@ */ public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber = null; - + public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; return this; } - /** - * Get justNumber - * @return justNumber + + /** + * Get justNumber + * @return justNumber **/ @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } - public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,8 +64,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -87,5 +86,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java index 6976ceb8fba..0a6d7ad0933 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java @@ -26,26 +26,26 @@ */ public class Order { + @JsonProperty("id") private Long id = null; - + @JsonProperty("petId") private Long petId = null; - + @JsonProperty("quantity") private Integer quantity = null; - + @JsonProperty("shipDate") private OffsetDateTime shipDate = null; - - /** + + /** * Order Status */ public enum StatusEnum { - PLACED("placed"), + PLACED("placed"), APPROVED("approved"), - DELIVERED("delivered"); private String value; @@ -53,8 +53,9 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -63,8 +64,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -73,123 +75,124 @@ public static StatusEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("status") private StatusEnum status = null; - + @JsonProperty("complete") private Boolean complete = false; - + public Order id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Order petId(Long petId) { this.petId = petId; return this; } - /** - * Get petId - * @return petId + + /** + * Get petId + * @return petId **/ @ApiModelProperty(value = "") public Long getPetId() { return petId; } - public void setPetId(Long petId) { this.petId = petId; } - + public Order quantity(Integer quantity) { this.quantity = quantity; return this; } - /** - * Get quantity - * @return quantity + + /** + * Get quantity + * @return quantity **/ @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } - public void setQuantity(Integer quantity) { this.quantity = quantity; } - + public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; return this; } - /** - * Get shipDate - * @return shipDate + + /** + * Get shipDate + * @return shipDate **/ @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } - public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } - + public Order status(StatusEnum status) { this.status = status; return this; } - /** - * Order Status - * @return status + + /** + * Order Status + * @return status **/ @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - + public Order complete(Boolean complete) { this.complete = complete; return this; } - /** - * Get complete - * @return complete + + /** + * Get complete + * @return complete **/ @ApiModelProperty(value = "") public Boolean isComplete() { return complete; } - public void setComplete(Boolean complete) { this.complete = complete; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -211,8 +214,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -239,5 +241,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterComposite.java index 02c16a99b70..8b957f45a14 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterComposite.java @@ -26,70 +26,70 @@ */ public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber = null; - + @JsonProperty("my_string") private String myString = null; - + @JsonProperty("my_boolean") private Boolean myBoolean = null; - + public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; return this; } - /** - * Get myNumber - * @return myNumber + + /** + * Get myNumber + * @return myNumber **/ @ApiModelProperty(value = "") public BigDecimal getMyNumber() { return myNumber; } - public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } - + public OuterComposite myString(String myString) { this.myString = myString; return this; } - /** - * Get myString - * @return myString + + /** + * Get myString + * @return myString **/ @ApiModelProperty(value = "") public String getMyString() { return myString; } - public void setMyString(String myString) { this.myString = myString; } - + public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; return this; } - /** - * Get myBoolean - * @return myBoolean + + /** + * Get myBoolean + * @return myBoolean **/ @ApiModelProperty(value = "") public Boolean getMyBoolean() { return myBoolean; } - public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -108,8 +108,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(myNumber, myString, myBoolean); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -133,5 +132,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterEnum.java index 948d80c2e6d..3390d473c7b 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterEnum.java @@ -13,14 +13,17 @@ package io.swagger.client.model; -import java.util.Objects; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + + /** * Gets or Sets OuterEnum */ + public enum OuterEnum { PLACED("placed"), @@ -35,7 +38,9 @@ public enum OuterEnum { this.value = value; } + @JsonValue + public String getValue() { return value; } @@ -45,7 +50,9 @@ public String toString() { return String.valueOf(value); } + @JsonCreator + public static OuterEnum fromValue(String text) { for (OuterEnum b : OuterEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -54,5 +61,8 @@ public static OuterEnum fromValue(String text) { } return null; } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java index 4c351dec3e4..ab51be3365d 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java @@ -29,29 +29,29 @@ */ public class Pet { + @JsonProperty("id") private Long id = null; - + @JsonProperty("category") private Category category = null; - + @JsonProperty("name") private String name = null; - + @JsonProperty("photoUrls") private List photoUrls = new ArrayList(); - + @JsonProperty("tags") private List tags = null; - - /** + + /** * pet status in the store */ public enum StatusEnum { - AVAILABLE("available"), + AVAILABLE("available"), PENDING("pending"), - SOLD("sold"); private String value; @@ -59,8 +59,9 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -69,8 +70,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -79,133 +81,135 @@ public static StatusEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("status") private StatusEnum status = null; - + public Pet id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Pet category(Category category) { this.category = category; return this; } - /** - * Get category - * @return category + + /** + * Get category + * @return category **/ @ApiModelProperty(value = "") public Category getCategory() { return category; } - public void setCategory(Category category) { this.category = category; } - + public Pet name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - + public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); return this; } - - /** - * Get photoUrls - * @return photoUrls + + /** + * Get photoUrls + * @return photoUrls **/ @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } - + public Pet tags(List tags) { this.tags = tags; return this; } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { this.tags = new ArrayList(); } + this.tags.add(tagsItem); return this; } - - /** - * Get tags - * @return tags + + /** + * Get tags + * @return tags **/ @ApiModelProperty(value = "") public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } - + public Pet status(StatusEnum status) { this.status = status; return this; } - /** - * pet status in the store - * @return status + + /** + * pet status in the store + * @return status **/ @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -227,8 +231,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -255,5 +258,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 76f8a912f36..1532a30b9e9 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -25,40 +25,41 @@ */ public class ReadOnlyFirst { + @JsonProperty("bar") private String bar = null; - + @JsonProperty("baz") private String baz = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; } - /** - * Get baz - * @return baz + + /** + * Get baz + * @return baz **/ @ApiModelProperty(value = "") public String getBaz() { return baz; } - public void setBaz(String baz) { this.baz = baz; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -76,8 +77,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, baz); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,5 +100,8 @@ private String toIndentedString(java.lang.Object o) { 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 784eb8baca8..38b54fd6c38 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 @@ -25,28 +25,28 @@ */ public class SpecialModelName { - @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + @JsonProperty("$special[property.name]") + private Long $specialPropertyName = null; + + 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; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -55,22 +55,21 @@ public boolean equals(java.lang.Object o) { 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); } - - + @Override public String toString() { 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(); } @@ -86,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Tag.java index 1cf2f5bc5e6..2967322b174 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Tag.java @@ -25,49 +25,49 @@ */ public class Tag { + @JsonProperty("id") private Long id = null; - + @JsonProperty("name") private String name = null; - + public Tag id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Tag name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -85,8 +85,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -109,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/User.java index de5bc439c5a..cb2f9f34084 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/User.java @@ -25,175 +25,175 @@ */ public class User { + @JsonProperty("id") private Long id = null; - + @JsonProperty("username") private String username = null; - + @JsonProperty("firstName") private String firstName = null; - + @JsonProperty("lastName") private String lastName = null; - + @JsonProperty("email") private String email = null; - + @JsonProperty("password") private String password = null; - + @JsonProperty("phone") private String phone = null; - + @JsonProperty("userStatus") private Integer userStatus = null; - + public User id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public User username(String username) { this.username = username; return this; } - /** - * Get username - * @return username + + /** + * Get username + * @return username **/ @ApiModelProperty(value = "") public String getUsername() { return username; } - public void setUsername(String username) { this.username = username; } - + public User firstName(String firstName) { this.firstName = firstName; return this; } - /** - * Get firstName - * @return firstName + + /** + * Get firstName + * @return firstName **/ @ApiModelProperty(value = "") public String getFirstName() { return firstName; } - public void setFirstName(String firstName) { this.firstName = firstName; } - + public User lastName(String lastName) { this.lastName = lastName; return this; } - /** - * Get lastName - * @return lastName + + /** + * Get lastName + * @return lastName **/ @ApiModelProperty(value = "") public String getLastName() { return lastName; } - public void setLastName(String lastName) { this.lastName = lastName; } - + public User email(String email) { this.email = email; return this; } - /** - * Get email - * @return email + + /** + * Get email + * @return email **/ @ApiModelProperty(value = "") public String getEmail() { return email; } - public void setEmail(String email) { this.email = email; } - + public User password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - + public User phone(String phone) { this.phone = phone; return this; } - /** - * Get phone - * @return phone + + /** + * Get phone + * @return phone **/ @ApiModelProperty(value = "") public String getPhone() { return phone; } - public void setPhone(String phone) { this.phone = phone; } - + public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; } - /** - * User Status - * @return userStatus + + /** + * User Status + * @return userStatus **/ @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } - public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -217,8 +217,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -247,5 +246,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..f2b031f9485 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 @@ -15,14 +15,17 @@ import io.swagger.client.ApiException; import io.swagger.client.model.Client; + 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 AnotherFakeApi */ @@ -42,8 +45,10 @@ 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..9710cbe6764 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,17 +16,18 @@ import io.swagger.client.ApiException; 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 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 FakeApi */ @@ -46,7 +47,9 @@ public class FakeApiTest { */ @Test public void fakeOuterBooleanSerializeTest() throws ApiException { + Boolean body = null; + Boolean response = api.fakeOuterBooleanSerialize(body); // TODO: test validations @@ -62,8 +65,10 @@ public void fakeOuterBooleanSerializeTest() throws ApiException { */ @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 } @@ -78,7 +83,9 @@ public void fakeOuterCompositeSerializeTest() throws ApiException { */ @Test public void fakeOuterNumberSerializeTest() throws ApiException { + BigDecimal body = null; + BigDecimal response = api.fakeOuterNumberSerialize(body); // TODO: test validations @@ -94,7 +101,9 @@ public void fakeOuterNumberSerializeTest() throws ApiException { */ @Test public void fakeOuterStringSerializeTest() throws ApiException { + String body = null; + String response = api.fakeOuterStringSerialize(body); // TODO: test validations @@ -110,8 +119,10 @@ public void fakeOuterStringSerializeTest() throws ApiException { */ @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 } @@ -126,21 +137,10 @@ public void testClientModelTest() throws ApiException { */ @Test public void testEndpointParametersTest() throws ApiException { - BigDecimal number = null; - Double _double = null; - String patternWithoutDelimiter = null; - byte[] _byte = null; - Integer integer = null; - Integer int32 = null; - Long int64 = null; - Float _float = null; - String string = null; - byte[] binary = null; - LocalDate date = null; - OffsetDateTime dateTime = null; - String password = null; - String paramCallback = null; - api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + + Object body = null; + + api.testEndpointParameters(body); // TODO: test validations } @@ -155,15 +155,20 @@ public void testEndpointParametersTest() throws ApiException { */ @Test public void testEnumParametersTest() throws ApiException { - List enumFormStringArray = null; - String enumFormString = null; + + Object body = 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); + + api.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); // TODO: test validations } @@ -178,8 +183,10 @@ public void testEnumParametersTest() throws ApiException { */ @Test public void testInlineAdditionalPropertiesTest() throws ApiException { - Object param = null; - api.testInlineAdditionalProperties(param); + + Map body = null; + + api.testInlineAdditionalProperties(body); // TODO: test validations } @@ -194,9 +201,10 @@ public void testInlineAdditionalPropertiesTest() throws ApiException { */ @Test public void testJsonFormDataTest() throws ApiException { - String param = null; - String param2 = null; - api.testJsonFormData(param, param2); + + Object body = null; + + api.testJsonFormData(body); // 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..dbda3faa692 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 @@ -15,14 +15,17 @@ import io.swagger.client.ApiException; import io.swagger.client.model.Client; + 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 FakeClassnameTags123Api */ @@ -42,8 +45,10 @@ 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/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..f02c13872eb 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 @@ -14,17 +14,19 @@ 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 */ @@ -44,8 +46,10 @@ public class PetApiTest { */ @Test public void addPetTest() throws ApiException { - Pet body = null; - api.addPet(body); + + Pet pet = null; + + api.addPet(pet); // TODO: test validations } @@ -60,8 +64,11 @@ public void addPetTest() throws ApiException { */ @Test public void deletePetTest() throws ApiException { - Long petId = null; + + Integer petId = null; + String apiKey = null; + api.deletePet(petId, apiKey); // TODO: test validations @@ -77,7 +84,9 @@ public void deletePetTest() throws ApiException { */ @Test public void findPetsByStatusTest() throws ApiException { + List status = null; + List response = api.findPetsByStatus(status); // TODO: test validations @@ -93,7 +102,9 @@ public void findPetsByStatusTest() throws ApiException { */ @Test public void findPetsByTagsTest() throws ApiException { + List tags = null; + List response = api.findPetsByTags(tags); // TODO: test validations @@ -109,7 +120,9 @@ public void findPetsByTagsTest() throws ApiException { */ @Test public void getPetByIdTest() throws ApiException { - Long petId = null; + + Integer petId = null; + Pet response = api.getPetById(petId); // TODO: test validations @@ -125,8 +138,10 @@ public void getPetByIdTest() throws ApiException { */ @Test public void updatePetTest() throws ApiException { - Pet body = null; - api.updatePet(body); + + Pet pet = null; + + api.updatePet(pet); // TODO: test validations } @@ -141,10 +156,12 @@ public void updatePetTest() throws ApiException { */ @Test public void updatePetWithFormTest() throws ApiException { - Long petId = null; - String name = null; - String status = null; - api.updatePetWithForm(petId, name, status); + + Integer petId = null; + + Object body = null; + + api.updatePetWithForm(petId, body); // TODO: test validations } @@ -159,10 +176,12 @@ public void updatePetWithFormTest() throws ApiException { */ @Test public void uploadFileTest() throws ApiException { - Long petId = null; - String additionalMetadata = null; - File file = null; - ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + + Integer petId = null; + + Object body = null; + + ModelApiResponse response = api.uploadFile(petId, body); // 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..c6d9b89f0bd 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 @@ -15,14 +15,17 @@ 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 */ @@ -42,7 +45,9 @@ public class StoreApiTest { */ @Test public void deleteOrderTest() throws ApiException { + String orderId = null; + api.deleteOrder(orderId); // TODO: test validations @@ -58,6 +63,7 @@ public void deleteOrderTest() throws ApiException { */ @Test public void getInventoryTest() throws ApiException { + Map response = api.getInventory(); // TODO: test validations @@ -73,7 +79,9 @@ public void getInventoryTest() throws ApiException { */ @Test public void getOrderByIdTest() throws ApiException { - Long orderId = null; + + Integer orderId = null; + Order response = api.getOrderById(orderId); // TODO: test validations @@ -89,8 +97,10 @@ public void getOrderByIdTest() throws ApiException { */ @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..175f42fca9c 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 @@ -15,14 +15,17 @@ 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 */ @@ -42,8 +45,10 @@ 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,7 +63,9 @@ public void createUserTest() throws ApiException { */ @Test public void createUsersWithArrayInputTest() throws ApiException { + List body = null; + api.createUsersWithArrayInput(body); // TODO: test validations @@ -74,7 +81,9 @@ public void createUsersWithArrayInputTest() throws ApiException { */ @Test public void createUsersWithListInputTest() throws ApiException { + List body = null; + api.createUsersWithListInput(body); // TODO: test validations @@ -90,7 +99,9 @@ public void createUsersWithListInputTest() throws ApiException { */ @Test public void deleteUserTest() throws ApiException { + String username = null; + api.deleteUser(username); // TODO: test validations @@ -106,7 +117,9 @@ public void deleteUserTest() throws ApiException { */ @Test public void getUserByNameTest() throws ApiException { + String username = null; + User response = api.getUserByName(username); // TODO: test validations @@ -122,8 +135,11 @@ public void getUserByNameTest() throws ApiException { */ @Test public void loginUserTest() throws ApiException { + String username = null; + String password = null; + String response = api.loginUser(username, password); // TODO: test validations @@ -139,6 +155,7 @@ public void loginUserTest() throws ApiException { */ @Test public void logoutUserTest() throws ApiException { + api.logoutUser(); // TODO: test validations @@ -154,9 +171,12 @@ public void logoutUserTest() throws ApiException { */ @Test public void updateUserTest() throws ApiException { + + User user = null; + String username = null; - User body = null; - api.updateUser(username, body); + + api.updateUser(user, username); // 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/resteasy/.swagger-codegen/VERSION b/samples/client/petstore/java/resteasy/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/client/petstore/java/resteasy/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/resteasy/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resteasy/README.md b/samples/client/petstore/java/resteasy/README.md index 4e4673592f7..1cd9250b22a 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 - +# swagger-petstore-resteasy + +## 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-petstore-resteasy + 1.0.0 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy +compile "io.swagger:swagger-petstore-resteasy:1.0.0" +``` + +### Others + +At first generate the JAR by executing: + + mvn package + +Then manually install the following JARs: + +* target/swagger-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) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + + + AnotherFakeApi apiInstance = new AnotherFakeApi(); + + Client 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* | [**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) + - [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) + - [OuterComposite](docs/OuterComposite.md) + - [OuterEnum](docs/OuterEnum.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**: + - : + + + + + +## 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 05970eaa2d8..a525fe00231 100644 --- a/samples/client/petstore/java/resteasy/build.gradle +++ b/samples/client/petstore/java/resteasy/build.gradle @@ -32,8 +32,11 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 23 } compileOptions { + + sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 + } // Rename the aar correctly @@ -77,8 +80,11 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven' + + sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 + install { repositories.mavenInstaller { @@ -96,7 +102,10 @@ ext { swagger_annotations_version = "1.5.8" jackson_version = "2.7.5" jersey_version = "2.22.2" + jodatime_version = "2.9.4" + + junit_version = "4.12" } @@ -108,8 +117,12 @@ dependencies { compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" + + compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" compile "joda-time:joda-time:$jodatime_version" compile "com.brsanthu:migbase64:2.2" + + testCompile "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/resteasy/build.sbt b/samples/client/petstore/java/resteasy/build.sbt index 7ef8075935f..ba957031285 100644 --- a/samples/client/petstore/java/resteasy/build.sbt +++ b/samples/client/petstore/java/resteasy/build.sbt @@ -16,9 +16,13 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-core" % "2.7.5", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.7.5", "com.fasterxml.jackson.core" % "jackson-databind" % "2.7.5", + + "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.7.5", "joda-time" % "joda-time" % "2.9.4", "com.brsanthu" % "migbase64" % "2.2", + + "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) diff --git a/samples/client/petstore/java/resteasy/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/resteasy/docs/AdditionalPropertiesClass.md index 0437c4dd8cc..b37862da7cf 100644 --- a/samples/client/petstore/java/resteasy/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/java/resteasy/docs/AdditionalPropertiesClass.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resteasy/docs/Animal.md b/samples/client/petstore/java/resteasy/docs/Animal.md index b3f325c3524..346caaf63f4 100644 --- a/samples/client/petstore/java/resteasy/docs/Animal.md +++ b/samples/client/petstore/java/resteasy/docs/Animal.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resteasy/docs/AnimalFarm.md b/samples/client/petstore/java/resteasy/docs/AnimalFarm.md deleted file mode 100644 index c7c7f1ddcce..00000000000 --- a/samples/client/petstore/java/resteasy/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ - -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - diff --git a/samples/client/petstore/java/resteasy/docs/AnotherFakeApi.md b/samples/client/petstore/java/resteasy/docs/AnotherFakeApi.md index 7a04619aaba..fb5c988e6cc 100644 --- a/samples/client/petstore/java/resteasy/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/resteasy/docs/AnotherFakeApi.md @@ -7,9 +7,11 @@ Method | HTTP request | Description [**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -22,10 +24,13 @@ To test special tags //import io.swagger.client.api.AnotherFakeApi; + AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +42,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -52,3 +58,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + + diff --git a/samples/client/petstore/java/resteasy/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/resteasy/docs/ArrayOfArrayOfNumberOnly.md index 77292549927..3671a5e9190 100644 --- a/samples/client/petstore/java/resteasy/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/java/resteasy/docs/ArrayOfArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resteasy/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/resteasy/docs/ArrayOfNumberOnly.md index e8cc4cd36dc..30b9b6648f4 100644 --- a/samples/client/petstore/java/resteasy/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/java/resteasy/docs/ArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resteasy/docs/ArrayTest.md b/samples/client/petstore/java/resteasy/docs/ArrayTest.md index 9feee16427f..4ab76343030 100644 --- a/samples/client/petstore/java/resteasy/docs/ArrayTest.md +++ b/samples/client/petstore/java/resteasy/docs/ArrayTest.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resteasy/docs/Capitalization.md b/samples/client/petstore/java/resteasy/docs/Capitalization.md index 0f3064c1996..9af7864f97e 100644 --- a/samples/client/petstore/java/resteasy/docs/Capitalization.md +++ b/samples/client/petstore/java/resteasy/docs/Capitalization.md @@ -13,3 +13,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resteasy/docs/Cat.md b/samples/client/petstore/java/resteasy/docs/Cat.md index 6e9f71ce7dd..5e408344021 100644 --- a/samples/client/petstore/java/resteasy/docs/Cat.md +++ b/samples/client/petstore/java/resteasy/docs/Cat.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **declawed** | **Boolean** | | [optional] + diff --git a/samples/client/petstore/java/resteasy/docs/Category.md b/samples/client/petstore/java/resteasy/docs/Category.md index e2df0803278..deb5a3e2a52 100644 --- a/samples/client/petstore/java/resteasy/docs/Category.md +++ b/samples/client/petstore/java/resteasy/docs/Category.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resteasy/docs/ClassModel.md b/samples/client/petstore/java/resteasy/docs/ClassModel.md index 64f880c8786..49c281cc0ed 100644 --- a/samples/client/petstore/java/resteasy/docs/ClassModel.md +++ b/samples/client/petstore/java/resteasy/docs/ClassModel.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resteasy/docs/Client.md b/samples/client/petstore/java/resteasy/docs/Client.md index 5c490ea166c..52b2f72c79c 100644 --- a/samples/client/petstore/java/resteasy/docs/Client.md +++ b/samples/client/petstore/java/resteasy/docs/Client.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resteasy/docs/Dog.md b/samples/client/petstore/java/resteasy/docs/Dog.md index ac7cea323ff..00e6446e9f5 100644 --- a/samples/client/petstore/java/resteasy/docs/Dog.md +++ b/samples/client/petstore/java/resteasy/docs/Dog.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **breed** | **String** | | [optional] + diff --git a/samples/client/petstore/java/resteasy/docs/EnumArrays.md b/samples/client/petstore/java/resteasy/docs/EnumArrays.md index 4dddc0bfd27..939a0e69587 100644 --- a/samples/client/petstore/java/resteasy/docs/EnumArrays.md +++ b/samples/client/petstore/java/resteasy/docs/EnumArrays.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] + ## Enum: JustSymbolEnum Name | Value @@ -20,8 +21,6 @@ DOLLAR | "$" ## Enum: List<ArrayEnumEnum> Name | Value ---- | ----- -FISH | "fish" -CRAB | "crab" diff --git a/samples/client/petstore/java/resteasy/docs/EnumTest.md b/samples/client/petstore/java/resteasy/docs/EnumTest.md index 08fee344882..9722c621962 100644 --- a/samples/client/petstore/java/resteasy/docs/EnumTest.md +++ b/samples/client/petstore/java/resteasy/docs/EnumTest.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] + ## Enum: EnumStringEnum Name | Value diff --git a/samples/client/petstore/java/resteasy/docs/FakeApi.md b/samples/client/petstore/java/resteasy/docs/FakeApi.md index 737ccc28293..6690b870e4e 100644 --- a/samples/client/petstore/java/resteasy/docs/FakeApi.md +++ b/samples/client/petstore/java/resteasy/docs/FakeApi.md @@ -15,6 +15,8 @@ Method | HTTP request | Description [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data + + # **fakeOuterBooleanSerialize** > Boolean fakeOuterBooleanSerialize(body) @@ -30,8 +32,11 @@ Test serialization of outer boolean types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body + +Boolean body = ; // Boolean | Input boolean as post body + try { Boolean result = apiInstance.fakeOuterBooleanSerialize(body); System.out.println(result); @@ -47,6 +52,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + ### Return type **Boolean** @@ -57,12 +63,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outercomposite) @@ -75,10 +82,13 @@ Test serialization of object with outer number type //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body + +OuterComposite 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 +100,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outercomposite** | [**OuterComposite**](.md)| Input composite as post body | [optional] + ### Return type @@ -102,8 +113,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterNumberSerialize** @@ -120,8 +132,11 @@ Test serialization of outer number types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body + +BigDecimal body = ; // BigDecimal | Input number as post body + try { BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); System.out.println(result); @@ -137,6 +152,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + ### Return type [**BigDecimal**](BigDecimal.md) @@ -147,8 +163,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterStringSerialize** @@ -165,8 +182,11 @@ Test serialization of outer string types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String body = "body_example"; // String | Input string as post body + +String body = ; // String | Input string as post body + try { String result = apiInstance.fakeOuterStringSerialize(body); System.out.println(result); @@ -182,6 +202,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**String**](String.md)| Input string as post body | [optional] + ### Return type **String** @@ -192,12 +213,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -210,10 +232,13 @@ To test \"client\" model //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +250,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -240,9 +266,10 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + # **testEndpointParameters** -> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) +> testEndpointParameters(body) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -251,36 +278,17 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### 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.FakeApi; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure HTTP basic authorization: http_basic_test -HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); -http_basic_test.setUsername("YOUR USERNAME"); -http_basic_test.setPassword("YOUR PASSWORD"); 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 -Integer integer = 56; // Integer | None -Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None -Float _float = 3.4F; // Float | None -String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None -LocalDate date = new LocalDate(); // LocalDate | None -OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None -String password = "password_example"; // String | None -String paramCallback = "paramCallback_example"; // String | None + +Object body = ; // Object | + try { - apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + apiInstance.testEndpointParameters(body); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEndpointParameters"); e.printStackTrace(); @@ -291,20 +299,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **BigDecimal**| None | - **_double** | **Double**| None | - **patternWithoutDelimiter** | **String**| None | - **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] - **int64** | **Long**| None | [optional] - **_float** | **Float**| None | [optional] - **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] - **date** | **LocalDate**| None | [optional] - **dateTime** | **OffsetDateTime**| None | [optional] - **password** | **String**| None | [optional] - **paramCallback** | **String**| None | [optional] + **body** | [**Object**](Object.md)| | + ### Return type @@ -317,11 +313,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 + - **Accept**: Not defined + # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger) To test enum parameters @@ -334,17 +331,23 @@ To test enum parameters //import io.swagger.client.api.FakeApi; + 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) + +Object body = ; // Object | + List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) -String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + +String enumHeaderString = Arrays.asList("enumHeaderString_example"); // 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) + +String enumQueryString = Arrays.asList("enumQueryString_example"); // String | Query parameter enum test (string) + +Integer enumQueryInteger = Arrays.asList(56); // Integer | Query parameter enum test (double) + try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -355,14 +358,13 @@ 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] + **body** | [**Object**](Object.md)| | [optional] + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: ] + **enumHeaderString** | [**String**](.md)| Header parameter enum test (string) | [optional] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: ] + **enumQueryString** | [**String**](.md)| Query parameter enum test (string) | [optional] + **enumQueryInteger** | [**Integer**](.md)| Query parameter enum test (double) | [optional] + ### Return type @@ -375,16 +377,15 @@ No authorization required ### HTTP request headers - **Content-Type**: */* - - **Accept**: */* + - **Accept**: Not defined + # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(body) test inline additionalProperties - - ### Example ```java // Import classes: @@ -392,10 +393,13 @@ test inline additionalProperties //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body + +Map body = ; // Map | request body + try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(body); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); e.printStackTrace(); @@ -406,7 +410,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **body** | [**Map<String, String>**](Map.md)| request body | + ### Return type @@ -421,14 +426,13 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined + # **testJsonFormData** -> testJsonFormData(param, param2) +> testJsonFormData(body) test json serialization of form data - - ### Example ```java // Import classes: @@ -436,11 +440,13 @@ test json serialization of form data //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String param = "param_example"; // String | field1 -String param2 = "param2_example"; // String | field2 + +Object body = ; // Object | + try { - apiInstance.testJsonFormData(param, param2); + apiInstance.testJsonFormData(body); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testJsonFormData"); e.printStackTrace(); @@ -451,8 +457,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **String**| field1 | - **param2** | **String**| field2 | + **body** | [**Object**](Object.md)| | + ### Return type @@ -467,3 +473,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined + + diff --git a/samples/client/petstore/java/resteasy/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/resteasy/docs/FakeClassnameTags123Api.md index bc728bfce5b..2bcbbb7908f 100644 --- a/samples/client/petstore/java/resteasy/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/resteasy/docs/FakeClassnameTags123Api.md @@ -7,33 +7,28 @@ Method | HTTP request | Description [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case ### 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.FakeClassnameTags123Api; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure API key authorization: api_key_query -ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); -api_key_query.setApiKey("YOUR API KEY"); -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model + +Client 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 +40,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -60,3 +56,5 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + + diff --git a/samples/client/petstore/java/resteasy/docs/FormatTest.md b/samples/client/petstore/java/resteasy/docs/FormatTest.md index c7a3acb3cb7..bc11b93cb26 100644 --- a/samples/client/petstore/java/resteasy/docs/FormatTest.md +++ b/samples/client/petstore/java/resteasy/docs/FormatTest.md @@ -11,8 +11,8 @@ Name | Type | Description | Notes **_float** | **Float** | | [optional] **_double** | **Double** | | [optional] **string** | **String** | | [optional] -**_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**_byte** | **String** | | +**binary** | **String** | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] @@ -20,3 +20,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resteasy/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/resteasy/docs/HasOnlyReadOnly.md index c1d0aac5672..5564ddcf28a 100644 --- a/samples/client/petstore/java/resteasy/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/java/resteasy/docs/HasOnlyReadOnly.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resteasy/docs/MapTest.md b/samples/client/petstore/java/resteasy/docs/MapTest.md index 714a97a40d9..74a6fe8ae70 100644 --- a/samples/client/petstore/java/resteasy/docs/MapTest.md +++ b/samples/client/petstore/java/resteasy/docs/MapTest.md @@ -8,12 +8,11 @@ Name | Type | Description | Notes **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] + ## Enum: Map<String, InnerEnum> Name | Value ---- | ----- -UPPER | "UPPER" -LOWER | "lower" diff --git a/samples/client/petstore/java/resteasy/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/resteasy/docs/MixedPropertiesAndAdditionalPropertiesClass.md index b12e2cd70e6..4507481b5a9 100644 --- a/samples/client/petstore/java/resteasy/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/resteasy/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resteasy/docs/Model200Response.md b/samples/client/petstore/java/resteasy/docs/Model200Response.md index 5b3a9a0e46d..8d2cc50bb83 100644 --- a/samples/client/petstore/java/resteasy/docs/Model200Response.md +++ b/samples/client/petstore/java/resteasy/docs/Model200Response.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resteasy/docs/ModelApiResponse.md b/samples/client/petstore/java/resteasy/docs/ModelApiResponse.md index 3eec8686cc9..06052b202f1 100644 --- a/samples/client/petstore/java/resteasy/docs/ModelApiResponse.md +++ b/samples/client/petstore/java/resteasy/docs/ModelApiResponse.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resteasy/docs/ModelReturn.md b/samples/client/petstore/java/resteasy/docs/ModelReturn.md index a679b04953e..a7845ba254b 100644 --- a/samples/client/petstore/java/resteasy/docs/ModelReturn.md +++ b/samples/client/petstore/java/resteasy/docs/ModelReturn.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resteasy/docs/Name.md b/samples/client/petstore/java/resteasy/docs/Name.md index ce2fb4dee50..a8d6fec9714 100644 --- a/samples/client/petstore/java/resteasy/docs/Name.md +++ b/samples/client/petstore/java/resteasy/docs/Name.md @@ -11,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resteasy/docs/NumberOnly.md b/samples/client/petstore/java/resteasy/docs/NumberOnly.md index a3feac7fadc..adfb36a95bb 100644 --- a/samples/client/petstore/java/resteasy/docs/NumberOnly.md +++ b/samples/client/petstore/java/resteasy/docs/NumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resteasy/docs/Order.md b/samples/client/petstore/java/resteasy/docs/Order.md index 268c617d1ff..7e4beff6df1 100644 --- a/samples/client/petstore/java/resteasy/docs/Order.md +++ b/samples/client/petstore/java/resteasy/docs/Order.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/resteasy/docs/OuterComposite.md b/samples/client/petstore/java/resteasy/docs/OuterComposite.md index 3f5a633c998..1963c7a0f73 100644 --- a/samples/client/petstore/java/resteasy/docs/OuterComposite.md +++ b/samples/client/petstore/java/resteasy/docs/OuterComposite.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resteasy/docs/Pet.md b/samples/client/petstore/java/resteasy/docs/Pet.md index 5b63109ef92..1492195a58d 100644 --- a/samples/client/petstore/java/resteasy/docs/Pet.md +++ b/samples/client/petstore/java/resteasy/docs/Pet.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/resteasy/docs/PetApi.md b/samples/client/petstore/java/resteasy/docs/PetApi.md index b5fa395947d..4758743434a 100644 --- a/samples/client/petstore/java/resteasy/docs/PetApi.md +++ b/samples/client/petstore/java/resteasy/docs/PetApi.md @@ -14,33 +14,28 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image + + # **addPet** -> addPet(body) +> addPet(pet) 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 + +Pet 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 +46,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -64,7 +60,8 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **deletePet** @@ -72,26 +69,20 @@ null (empty response body) 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 | + +Integer petId = Arrays.asList(56); // Integer | Pet id to delete + +String apiKey = Arrays.asList("apiKey_example"); // String | + try { apiInstance.deletePet(petId, apiKey); } catch (ApiException e) { @@ -104,8 +95,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | - **apiKey** | **String**| | [optional] + **petId** | [**Integer**](.md)| Pet id to delete | + **apiKey** | [**String**](.md)| | [optional] + ### Return type @@ -118,7 +110,8 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **findPetsByStatus** @@ -131,20 +124,15 @@ 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); @@ -158,7 +146,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: ] + ### Return type @@ -173,6 +162,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **findPetsByTags** > List<Pet> findPetsByTags(tags) @@ -184,20 +174,15 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### 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); @@ -213,6 +198,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | + ### Return type [**List<Pet>**](Pet.md) @@ -226,6 +212,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **getPetById** > Pet getPetById(petId) @@ -237,22 +224,15 @@ 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to return + try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -266,7 +246,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to return | + **petId** | [**Integer**](.md)| ID of pet to return | + ### Return type @@ -281,33 +262,27 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **updatePet** -> updatePet(body) +> updatePet(pet) 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 + +Pet 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 +293,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -331,37 +307,31 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updatePetWithForm** -> updatePetWithForm(petId, name, status) +> updatePetWithForm(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet that needs to be updated + +Object body = ; // Object | + try { - apiInstance.updatePetWithForm(petId, name, status); + apiInstance.updatePetWithForm(petId, body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePetWithForm"); e.printStackTrace(); @@ -372,9 +342,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet that needs to be updated | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -387,37 +357,31 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **uploadFile** -> ModelApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to update + +Object body = ; // Object | + try { - ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); + ModelApiResponse result = apiInstance.uploadFile(petId, body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFile"); @@ -429,9 +393,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet to update | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -446,3 +410,5 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json + + diff --git a/samples/client/petstore/java/resteasy/docs/ReadOnlyFirst.md b/samples/client/petstore/java/resteasy/docs/ReadOnlyFirst.md index 426b7cde95a..57655e5b49e 100644 --- a/samples/client/petstore/java/resteasy/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/java/resteasy/docs/ReadOnlyFirst.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resteasy/docs/SpecialModelName.md b/samples/client/petstore/java/resteasy/docs/SpecialModelName.md index c2c6117c552..f4259d2a73c 100644 --- a/samples/client/petstore/java/resteasy/docs/SpecialModelName.md +++ b/samples/client/petstore/java/resteasy/docs/SpecialModelName.md @@ -4,7 +4,8 @@ ## 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..a4678ee745c 100644 --- a/samples/client/petstore/java/resteasy/docs/StoreApi.md +++ b/samples/client/petstore/java/resteasy/docs/StoreApi.md @@ -10,6 +10,8 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + # **deleteOrder** > deleteOrder(orderId) @@ -25,8 +27,11 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + +String orderId = Arrays.asList("orderId_example"); // String | ID of the order that needs to be deleted + try { apiInstance.deleteOrder(orderId); } catch (ApiException e) { @@ -39,7 +44,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | + **orderId** | [**String**](.md)| ID of the order that needs to be deleted | + ### Return type @@ -52,7 +58,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getInventory** @@ -65,21 +72,13 @@ 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); @@ -92,6 +91,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type **Map<String, Integer>** @@ -105,6 +105,7 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json + # **getOrderById** > Order getOrderById(orderId) @@ -120,8 +121,11 @@ For valid response try integer IDs with value <= 5 or > 10. Other val //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched + +Integer orderId = Arrays.asList(56); // Integer | ID of pet that needs to be fetched + try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +139,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | [**Integer**](.md)| ID of pet that needs to be fetched | + ### Return type @@ -150,14 +155,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -165,10 +169,13 @@ Place an order for a pet //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet + +Order 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 +187,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](.md)| order placed for purchasing the pet | + ### Return type @@ -192,6 +200,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: */* - **Accept**: application/xml, application/json + + diff --git a/samples/client/petstore/java/resteasy/docs/Tag.md b/samples/client/petstore/java/resteasy/docs/Tag.md index de6814b55d5..7a97d4c6812 100644 --- a/samples/client/petstore/java/resteasy/docs/Tag.md +++ b/samples/client/petstore/java/resteasy/docs/Tag.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resteasy/docs/User.md b/samples/client/petstore/java/resteasy/docs/User.md index 8b6753dd284..cf7f9ce1312 100644 --- a/samples/client/petstore/java/resteasy/docs/User.md +++ b/samples/client/petstore/java/resteasy/docs/User.md @@ -15,3 +15,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resteasy/docs/UserApi.md b/samples/client/petstore/java/resteasy/docs/UserApi.md index 2e6987951c8..e421376ce79 100644 --- a/samples/client/petstore/java/resteasy/docs/UserApi.md +++ b/samples/client/petstore/java/resteasy/docs/UserApi.md @@ -14,9 +14,11 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + # **createUser** -> createUser(body) +> createUser(user) Create user @@ -29,10 +31,13 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object + +User 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 +48,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](.md)| Created user object | + ### Return type @@ -55,8 +61,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithArrayInput** @@ -64,8 +71,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -73,8 +78,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -89,6 +97,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type null (empty response body) @@ -99,8 +108,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithListInput** @@ -108,8 +118,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -117,8 +125,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { @@ -133,6 +144,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type null (empty response body) @@ -143,8 +155,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **deleteUser** @@ -161,8 +174,11 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be deleted + +String username = Arrays.asList("username_example"); // String | The name that needs to be deleted + try { apiInstance.deleteUser(username); } catch (ApiException e) { @@ -175,7 +191,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | + **username** | [**String**](.md)| The name that needs to be deleted | + ### Return type @@ -188,7 +205,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getUserByName** @@ -196,8 +214,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -205,8 +221,11 @@ Get user by user name //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. + +String username = Arrays.asList("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 +239,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + **username** | [**String**](.md)| The name that needs to be fetched. Use user1 for testing. | + ### Return type @@ -235,14 +255,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **loginUser** > String loginUser(username, password) Logs user into the system - - ### Example ```java // Import classes: @@ -250,9 +269,13 @@ Logs user into the system //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 + +String username = Arrays.asList("username_example"); // String | The user name for login + +String password = Arrays.asList("password_example"); // String | The password for login in clear text + try { String result = apiInstance.loginUser(username, password); System.out.println(result); @@ -266,8 +289,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | + **username** | [**String**](.md)| The user name for login | + **password** | [**String**](.md)| The password for login in clear text | + ### Return type @@ -282,14 +306,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **logoutUser** > logoutUser() Logs out current logged in user session - - ### Example ```java // Import classes: @@ -297,7 +320,9 @@ Logs out current logged in user session //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); + try { apiInstance.logoutUser(); } catch (ApiException e) { @@ -309,6 +334,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type null (empty response body) @@ -320,11 +346,12 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updateUser** -> updateUser(username, body) +> updateUser(user, username) Updated user @@ -337,11 +364,15 @@ This can only be done by the logged in user. //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 + +User user = ; // User | Updated user object + +String username = Arrays.asList("username_example"); // String | name that need to be deleted + try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(user, username); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -352,8 +383,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](.md)| Updated user object | + **username** | [**String**](.md)| name that need to be deleted | + ### Return type @@ -365,6 +397,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + + diff --git a/samples/client/petstore/java/resteasy/git_push.sh b/samples/client/petstore/java/resteasy/git_push.sh index ae01b182ae9..ed374619b13 100644 --- a/samples/client/petstore/java/resteasy/git_push.sh +++ b/samples/client/petstore/java/resteasy/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 credential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential 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/resteasy/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/resteasy/gradle/wrapper/gradle-wrapper.jar index 2c6137b8789..e69de29bb2d 100644 Binary files a/samples/client/petstore/java/resteasy/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/resteasy/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/resteasy/pom.xml b/samples/client/petstore/java/resteasy/pom.xml index c23663bcfc6..e2e75f88743 100644 --- a/samples/client/petstore/java/resteasy/pom.xml +++ b/samples/client/petstore/java/resteasy/pom.xml @@ -1,217 +1,207 @@ - 4.0.0 - io.swagger - swagger-petstore-resteasy - jar - swagger-petstore-resteasy - 1.0.0 - - scm:git:git@github.com:swagger-api/swagger-mustache.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-petstore-resteasy + jar + swagger-petstore-resteasy + 1.0.0 + + scm:git:git@github.com:swagger-api/swagger-mustache.git + scm:git:git@github.com:swagger-api/swagger-codegen.git + https://github.com/swagger-api/swagger-codegen + + + 2.2.0 + - - - - 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-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.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + jar + test-jar + + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - - - 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 - 2.5.1 - - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - - - - io.swagger - swagger-annotations - ${swagger-core-version} - - - - org.jboss.resteasy - resteasy-client - ${resteasy-version} - - - org.jboss.resteasy - resteasy-multipart-provider - ${resteasy-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-joda - ${jackson-version} - - - joda-time - joda-time - ${jodatime-version} - + + org.codehaus.mojo + build-helper-maven-plugin + + + 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 + 2.5.1 + + + + 1.7 + 1.7 + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + + + + io.swagger + swagger-annotations + ${swagger-core-version} + + + + org.jboss.resteasy + resteasy-client + ${resteasy-version} + + + org.jboss.resteasy + resteasy-multipart-provider + ${resteasy-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-joda + ${jackson-version} + + + joda-time + joda-time + ${jodatime-version} + - - - com.brsanthu - migbase64 - 2.2 - + + + com.brsanthu + migbase64 + 2.2 + + - - org.jboss.resteasy - resteasy-jackson2-provider - 3.1.3.Final - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-version} - - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.5.15 - 3.1.3.Final - 2.6.4 - 2.9.9 - 1.0.0 - 4.12 - + + + org.jboss.resteasy + resteasy-jackson-provider + 3.1.3.Final + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-version} + + + + junit + junit + ${junit-version} + test + + + + 1.5.15 + 3.1.3.Final + 2.6.4 + + 2.9.9 + + + 1.0.0 + 4.12 + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java index be342babbd0..3c6bcf92db4 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java @@ -79,7 +79,7 @@ public ApiClient() { authentications.put("api_key", new ApiKeyAuth("header", "api_key")); authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); authentications.put("http_basic_test", new HttpBasicAuth()); - authentications.put("petstore_auth", new OAuth()); + authentications.put("petstore_auth", new OAuth()); // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); } @@ -510,7 +510,10 @@ public T deserialize(Response response, GenericType returnType) throws Ap public File downloadFileFromResponse(Response response) throws ApiException { try { File file = prepareDownloadFile(response); + Files.copy(response.readEntity(InputStream.class), file.toPath()); + + return file; } catch (IOException e) { throw new ApiException(e); @@ -584,18 +587,18 @@ public T invokeAPI(String path, String method, List queryParams, Objec Invocation.Builder invocationBuilder = target.request().accept(accept); - for (Entry headerParamsEnrty : headerParams.entrySet()) { - String value = headerParamsEnrty.getValue(); + for (String key : headerParams.keySet()) { + String value = headerParams.get(key); if (value != null) { - invocationBuilder = invocationBuilder.header(headerParamsEnrty.getKey(), value); + invocationBuilder = invocationBuilder.header(key, value); } } - for (Entry defaultHeaderEnrty: defaultHeaderMap.entrySet()) { - if (!headerParams.containsKey(defaultHeaderEnrty.getKey())) { - String value = defaultHeaderEnrty.getKey(); + for (String key : defaultHeaderMap.keySet()) { + if (!headerParams.containsKey(key)) { + String value = defaultHeaderMap.get(key); if (value != null) { - invocationBuilder = invocationBuilder.header(defaultHeaderEnrty.getKey(), value); + invocationBuilder = invocationBuilder.header(key, value); } } } diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/JSON.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/JSON.java index f44d1e5c5ab..e8a94f4b79c 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/JSON.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/JSON.java @@ -2,8 +2,11 @@ import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; + + import com.fasterxml.jackson.datatype.joda.*; + import java.text.DateFormat; import javax.ws.rs.ext.ContextResolver; @@ -21,7 +24,10 @@ public JSON() { mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); mapper.setDateFormat(new RFC3339DateFormat()); + + mapper.registerModule(new JodaModule()); + } /** 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..b9c6b47a417 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 @@ -9,12 +9,16 @@ import io.swagger.client.model.Client; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class AnotherFakeApi { private ApiClient apiClient; @@ -34,19 +38,22 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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 @@ -57,9 +64,12 @@ public Client testSpecialTags(Client body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/json" }; @@ -72,7 +82,11 @@ public Client testSpecialTags(Client body) throws ApiException { String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + } + 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..7cb875334ed 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,16 +9,18 @@ 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 java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class FakeApi { private ApiClient apiClient; @@ -38,12 +40,15 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * * Test serialization of outer boolean types * @param body 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; @@ -56,33 +61,41 @@ public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * * 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"); @@ -92,30 +105,38 @@ public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Ap Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * * Test serialization of outer number types * @param body Input number as post body (optional) * @return BigDecimal * @throws ApiException if fails to make API call + + */ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException { Object localVarPostBody = body; @@ -128,30 +149,38 @@ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * * Test serialization of outer string types * @param body Input string as post body (optional) * @return String * @throws ApiException if fails to make API call + + */ public String fakeOuterStringSerialize(String body) throws ApiException { Object localVarPostBody = body; @@ -164,37 +193,45 @@ public String fakeOuterStringSerialize(String body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * 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 @@ -205,9 +242,12 @@ public Client testClientModel(Client body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/json" }; @@ -220,49 +260,26 @@ public Client testClientModel(Client body) throws ApiException { String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) + * @param body (required) * @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 { - Object localVarPostBody = null; - - // verify the required parameter 'number' is set - if (number == null) { - throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters"); - } - - // verify the required parameter '_double' is set - if (_double == null) { - throw new ApiException(400, "Missing the required parameter '_double' when calling testEndpointParameters"); - } - - // verify the required parameter 'patternWithoutDelimiter' is set - if (patternWithoutDelimiter == null) { - throw new ApiException(400, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); - } + public void testEndpointParameters(Object body) throws ApiException { + Object localVarPostBody = body; - // verify the required parameter '_byte' is set - if (_byte == null) { - throw new ApiException(400, "Missing the required parameter '_byte' when calling testEndpointParameters"); + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testEndpointParameters"); } // create path and map variables @@ -273,39 +290,14 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + - if (integer != null) - localVarFormParams.put("integer", integer); -if (int32 != null) - localVarFormParams.put("int32", int32); -if (int64 != null) - localVarFormParams.put("int64", int64); -if (number != null) - localVarFormParams.put("number", number); -if (_float != null) - localVarFormParams.put("float", _float); -if (_double != null) - localVarFormParams.put("double", _double); -if (string != null) - localVarFormParams.put("string", string); -if (patternWithoutDelimiter != null) - localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter); -if (_byte != null) - localVarFormParams.put("byte", _byte); -if (binary != null) - localVarFormParams.put("binary", binary); -if (date != null) - localVarFormParams.put("date", date); -if (dateTime != null) - localVarFormParams.put("dateTime", dateTime); -if (password != null) - localVarFormParams.put("password", password); -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); @@ -316,24 +308,26 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat String[] localVarAuthNames = new String[] { "http_basic_test" }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, 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 body (optional) * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumHeaderString Header parameter enum test (string) (optional) * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryString Query parameter enum test (string) (optional) * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (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 { - Object localVarPostBody = null; + public void testEnumParameters(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger) throws ApiException { + Object localVarPostBody = body; // create path and map variables String localVarPath = "/fake".replaceAll("\\{format\\}","json"); @@ -343,24 +337,24 @@ public void testEnumParameters(List enumFormStringArray, String enumForm Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray)); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string_array", enumQueryStringArray)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger)); + if (enumHeaderStringArray != null) localVarHeaderParams.put("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); -if (enumHeaderString != null) + if (enumHeaderString != null) localVarHeaderParams.put("enum_header_string", apiClient.parameterToString(enumHeaderString)); + - 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); + final String[] localVarAccepts = { - "*/*" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -371,21 +365,25 @@ public void testEnumParameters(List enumFormStringArray, String enumForm String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * test inline additionalProperties * - * @param param request body (required) + * @param body request body (required) * @throws ApiException if fails to make API call + + */ - public void testInlineAdditionalProperties(Object param) throws ApiException { - Object localVarPostBody = param; + public void testInlineAdditionalProperties(Map body) throws ApiException { + Object localVarPostBody = body; - // 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 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testInlineAdditionalProperties"); } // create path and map variables @@ -396,9 +394,12 @@ public void testInlineAdditionalProperties(Object param) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { }; @@ -411,27 +412,25 @@ public void testInlineAdditionalProperties(Object param) throws ApiException { String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * test json serialization of form data * - * @param param field1 (required) - * @param param2 field2 (required) + * @param body (required) * @throws ApiException if fails to make API call + + */ - public void testJsonFormData(String param, String param2) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'param' is set - if (param == null) { - throw new ApiException(400, "Missing the required parameter 'param' when calling testJsonFormData"); - } + public void testJsonFormData(Object body) throws ApiException { + Object localVarPostBody = body; - // verify the required parameter 'param2' is set - if (param2 == null) { - throw new ApiException(400, "Missing the required parameter 'param2' when calling testJsonFormData"); + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling testJsonFormData"); } // create path and map variables @@ -442,12 +441,11 @@ public void testJsonFormData(String param, String param2) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + - if (param != null) - localVarFormParams.put("param", param); -if (param2 != null) - localVarFormParams.put("param2", param2); final String[] localVarAccepts = { @@ -461,7 +459,10 @@ public void testJsonFormData(String param, String param2) throws ApiException { String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + } + 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 af570690376..979439e2d77 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 @@ -9,12 +9,16 @@ import io.swagger.client.model.Client; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class FakeClassnameTags123Api { private ApiClient apiClient; @@ -34,19 +38,22 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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 @@ -57,9 +64,12 @@ public Client testClassname(Client body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/json" }; @@ -72,7 +82,11 @@ public Client testClassname(Client body) throws ApiException { String[] localVarAuthNames = new String[] { "api_key_query" }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + } + 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..c51471aa6d7 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 @@ -7,16 +7,19 @@ import javax.ws.rs.core.GenericType; -import java.io.File; import io.swagger.client.model.ModelApiResponse; import io.swagger.client.model.Pet; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class PetApi { private ApiClient apiClient; @@ -36,18 +39,21 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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 @@ -58,11 +64,14 @@ public void addPet(Pet body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -73,17 +82,21 @@ public void addPet(Pet body) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Deletes a pet * * @param petId Pet id to delete (required) * @param apiKey (optional) * @throws ApiException if fails to make API call + + */ - public void deletePet(Long petId, String apiKey) throws ApiException { + public void deletePet(Integer petId, String apiKey) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'petId' is set @@ -100,13 +113,16 @@ public void deletePet(Long petId, String apiKey) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + if (apiKey != null) localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey)); + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -117,15 +133,19 @@ public void deletePet(Long petId, String apiKey) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; - + apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter (required) * @return List * @throws ApiException if fails to make API call + + */ public List findPetsByStatus(List status) throws ApiException { Object localVarPostBody = null; @@ -143,10 +163,14 @@ public List findPetsByStatus(List status) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status)); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status)); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -159,9 +183,12 @@ public List findPetsByStatus(List status) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; + GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -169,6 +196,8 @@ public List findPetsByStatus(List status) throws ApiException { * @return List * @throws ApiException if fails to make API call * @deprecated + + */ @Deprecated public List findPetsByTags(List tags) throws ApiException { @@ -187,10 +216,14 @@ public List findPetsByTags(List tags) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags)); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "tags", tags)); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -203,17 +236,22 @@ public List findPetsByTags(List tags) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; + GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * Find pet by ID * Returns a single pet * @param petId ID of pet to return (required) * @return Pet * @throws ApiException if fails to make API call + + */ - public Pet getPetById(Long petId) throws ApiException { + public Pet getPetById(Integer petId) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'petId' is set @@ -230,9 +268,12 @@ public Pet getPetById(Long petId) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -245,21 +286,26 @@ public Pet getPetById(Long petId) throws ApiException { String[] localVarAuthNames = new String[] { "api_key" }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * 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 @@ -270,11 +316,14 @@ public void updatePet(Pet body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -285,19 +334,22 @@ public void updatePet(Pet body) throws ApiException { String[] localVarAuthNames = new String[] { "petstore_auth" }; - + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Updates a pet in the store with form data * * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) + * @param body (optional) * @throws ApiException if fails to make API call + + */ - public void updatePetWithForm(Long petId, String name, String status) throws ApiException { - Object localVarPostBody = null; + public void updatePetWithForm(Integer petId, Object body) throws ApiException { + Object localVarPostBody = body; // verify the required parameter 'petId' is set if (petId == null) { @@ -313,15 +365,14 @@ public void updatePetWithForm(Long petId, String name, String status) throws Api Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + - if (name != null) - localVarFormParams.put("name", name); -if (status != null) - localVarFormParams.put("status", status); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -332,20 +383,23 @@ public void updatePetWithForm(Long petId, String name, String status) throws Api String[] localVarAuthNames = new String[] { "petstore_auth" }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * uploads an image * * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) + * @param body (optional) * @return ModelApiResponse * @throws ApiException if fails to make API call + + */ - public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException { - Object localVarPostBody = null; + public ModelApiResponse uploadFile(Integer petId, Object body) throws ApiException { + Object localVarPostBody = body; // verify the required parameter 'petId' is set if (petId == null) { @@ -361,12 +415,11 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + - if (additionalMetadata != null) - localVarFormParams.put("additionalMetadata", additionalMetadata); -if (file != null) - localVarFormParams.put("file", file); final String[] localVarAccepts = { "application/json" @@ -380,7 +433,11 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f String[] localVarAuthNames = new String[] { "petstore_auth" }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + } + 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..d55f38147ac 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 @@ -9,12 +9,16 @@ import io.swagger.client.model.Order; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class StoreApi { private ApiClient apiClient; @@ -34,11 +38,14 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted (required) * @throws ApiException if fails to make API call + + */ public void deleteOrder(String orderId) throws ApiException { Object localVarPostBody = null; @@ -57,11 +64,14 @@ public void deleteOrder(String orderId) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -72,14 +82,18 @@ public void deleteOrder(String orderId) throws ApiException { String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Returns pet inventories by status * Returns a map of status codes to quantities * @return Map * @throws ApiException if fails to make API call + + */ public Map getInventory() throws ApiException { Object localVarPostBody = null; @@ -92,9 +106,12 @@ public Map getInventory() throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/json" }; @@ -107,17 +124,22 @@ public Map getInventory() throws ApiException { String[] localVarAuthNames = new String[] { "api_key" }; + GenericType> localVarReturnType = new GenericType>() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched (required) * @return Order * @throws ApiException if fails to make API call + + */ - public Order getOrderById(Long orderId) throws ApiException { + public Order getOrderById(Integer orderId) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'orderId' is set @@ -134,9 +156,12 @@ public Order getOrderById(Long orderId) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -149,22 +174,27 @@ public Order getOrderById(Long orderId) throws ApiException { String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * 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 @@ -175,22 +205,29 @@ public Order placeOrder(Order body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + } + 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 7602f4e2ba9..00a212d0754 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 @@ -9,12 +9,16 @@ import io.swagger.client.model.User; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class UserApi { private ApiClient apiClient; @@ -34,18 +38,21 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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 @@ -56,29 +63,36 @@ public void createUser(User body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Creates list of users with given input array * * @param body List of user object (required) * @throws ApiException if fails to make API call + + */ public void createUsersWithArrayInput(List body) throws ApiException { Object localVarPostBody = body; @@ -96,29 +110,36 @@ public void createUsersWithArrayInput(List body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Creates list of users with given input array * * @param body List of user object (required) * @throws ApiException if fails to make API call + + */ public void createUsersWithListInput(List body) throws ApiException { Object localVarPostBody = body; @@ -136,29 +157,36 @@ public void createUsersWithListInput(List body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted (required) * @throws ApiException if fails to make API call + + */ public void deleteUser(String username) throws ApiException { Object localVarPostBody = null; @@ -177,11 +205,14 @@ public void deleteUser(String username) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -192,15 +223,19 @@ public void deleteUser(String username) throws ApiException { String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return User * @throws ApiException if fails to make API call + + */ public User getUserByName(String username) throws ApiException { Object localVarPostBody = null; @@ -219,9 +254,12 @@ public User getUserByName(String username) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -234,9 +272,12 @@ public User getUserByName(String username) throws ApiException { String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * Logs user into the system * @@ -244,6 +285,8 @@ public User getUserByName(String username) throws ApiException { * @param password The password for login in clear text (required) * @return String * @throws ApiException if fails to make API call + + */ public String loginUser(String username, String password) throws ApiException { Object localVarPostBody = null; @@ -266,11 +309,16 @@ public String loginUser(String username, String password) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "password", password)); + + + final String[] localVarAccepts = { "application/xml", "application/json" }; @@ -283,13 +331,18 @@ public String loginUser(String username, String password) throws ApiException { String[] localVarAuthNames = new String[] { }; + GenericType localVarReturnType = new GenericType() {}; return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } + + } + /** * Logs out current logged in user session * * @throws ApiException if fails to make API call + + */ public void logoutUser() throws ApiException { Object localVarPostBody = null; @@ -302,11 +355,14 @@ public void logoutUser() throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); @@ -317,29 +373,33 @@ public void logoutUser() throws ApiException { String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + /** * Updated user * This can only be done by the logged in user. + * @param user Updated user object (required) * @param username name that need to be deleted (required) - * @param body 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(User user, String username) throws ApiException { + Object localVarPostBody = user; + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser"); + } // 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"); - } - // create path and map variables String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json") .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); @@ -349,22 +409,28 @@ public void updateUser(String username, User body) throws ApiException { Map localVarHeaderParams = new HashMap(); Map localVarFormParams = new HashMap(); + + + final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); + } + } + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/auth/HttpBasicAuth.java index 788b63a9918..44f4f86e490 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/auth/HttpBasicAuth.java @@ -15,14 +15,19 @@ import io.swagger.client.Pair; + import com.migcomponents.migbase64.Base64; + + import java.util.Map; import java.util.List; + import java.io.UnsupportedEncodingException; + public class HttpBasicAuth implements Authentication { private String username; private String password; @@ -49,10 +54,13 @@ public void applyToParams(List queryParams, Map headerPara return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); + try { headerParams.put("Authorization", "Basic " + Base64.encodeToString(str.getBytes("UTF-8"), false)); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } + + } } diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 7fe69e168fd..c226acf8619 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -28,65 +28,65 @@ */ public class AdditionalPropertiesClass { + @JsonProperty("map_property") private Map mapProperty = null; - + @JsonProperty("map_of_map_property") private Map> mapOfMapProperty = null; - + public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; return this; } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { this.mapProperty = new HashMap(); } + this.mapProperty.put(key, mapPropertyItem); return this; } - - /** - * Get mapProperty - * @return mapProperty + /** + * Get mapProperty + * @return mapProperty **/ @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } - public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } - + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; return this; } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { this.mapOfMapProperty = new HashMap>(); } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } - - /** - * Get mapOfMapProperty - * @return mapOfMapProperty + /** + * Get mapOfMapProperty + * @return mapOfMapProperty **/ @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -104,8 +104,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapProperty, mapOfMapProperty); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -128,5 +127,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Animal.java index 590f36c0ae0..ddd1f98533f 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Animal.java @@ -25,56 +25,60 @@ /** * Animal */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true ) + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Discriminator{propertyName='className', mapping=null}", visible = true ) @JsonSubTypes({ + @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + }) public class Animal { + @JsonProperty("className") private String className = null; - + @JsonProperty("color") private String color = "red"; - + public Animal className(String className) { this.className = className; return this; } - /** - * Get className - * @return className + + /** + * Get className + * @return className **/ @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } - public void setClassName(String className) { this.className = className; } - + public Animal color(String color) { this.color = color; return this; } - /** - * Get color - * @return color + + /** + * Get color + * @return color **/ @ApiModelProperty(value = "") public String getColor() { return color; } - public void setColor(String color) { this.color = color; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -92,8 +96,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(className, color); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -116,5 +119,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/AnimalFarm.java deleted file mode 100644 index 0b1d6a74cc6..00000000000 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/AnimalFarm.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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 io.swagger.client.model.Animal; -import java.util.ArrayList; -import java.util.List; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index b7e59a030a4..380b98b1f70 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -28,36 +28,37 @@ */ public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") private List> arrayArrayNumber = null; - + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; return this; } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { this.arrayArrayNumber = new ArrayList>(); } + this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber **/ @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } - public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,8 +75,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayArrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -97,5 +97,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index fdfeb6856f3..482a3177a15 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -28,36 +28,37 @@ */ public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") private List arrayNumber = null; - + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; return this; } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { this.arrayNumber = new ArrayList(); } + this.arrayNumber.add(arrayNumberItem); return this; } - - /** - * Get arrayNumber - * @return arrayNumber + + /** + * Get arrayNumber + * @return arrayNumber **/ @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } - public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,8 +75,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -97,5 +97,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayTest.java index 62665c2536a..e70233c3c7f 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ArrayTest.java @@ -28,94 +28,97 @@ */ public class ArrayTest { + @JsonProperty("array_of_string") private List arrayOfString = null; - + @JsonProperty("array_array_of_integer") private List> arrayArrayOfInteger = null; - + @JsonProperty("array_array_of_model") private List> arrayArrayOfModel = null; - + public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; return this; } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { this.arrayOfString = new ArrayList(); } + this.arrayOfString.add(arrayOfStringItem); return this; } - - /** - * Get arrayOfString - * @return arrayOfString + + /** + * Get arrayOfString + * @return arrayOfString **/ @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } - public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } - + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { this.arrayArrayOfInteger = new ArrayList>(); } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger **/ @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } - + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { this.arrayArrayOfModel = new ArrayList>(); } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel **/ @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } - public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -134,8 +137,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -159,5 +161,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Capitalization.java index a72b0a72f46..f534657b4ca 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Capitalization.java @@ -25,133 +25,133 @@ */ public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel = null; - + @JsonProperty("CapitalCamel") private String capitalCamel = null; - + @JsonProperty("small_Snake") private String smallSnake = null; - + @JsonProperty("Capital_Snake") private String capitalSnake = null; - + @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints = null; - + @JsonProperty("ATT_NAME") private String ATT_NAME = null; - + public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; return this; } - /** - * Get smallCamel - * @return smallCamel + + /** + * Get smallCamel + * @return smallCamel **/ @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } - public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } - + public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; return this; } - /** - * Get capitalCamel - * @return capitalCamel + + /** + * Get capitalCamel + * @return capitalCamel **/ @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } - public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } - + public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; return this; } - /** - * Get smallSnake - * @return smallSnake + + /** + * Get smallSnake + * @return smallSnake **/ @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } - public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } - + public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; return this; } - /** - * Get capitalSnake - * @return capitalSnake + + /** + * Get capitalSnake + * @return capitalSnake **/ @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } - public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } - + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; return this; } - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints **/ @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } - public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } - + public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; return this; } - /** - * Name of the pet - * @return ATT_NAME + + /** + * Name of the pet + * @return ATT_NAME **/ @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } - public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -173,8 +173,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -201,5 +200,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Cat.java index b882da0ad90..d6e94912f06 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Cat.java @@ -26,28 +26,70 @@ */ public class Cat extends Animal { + + @JsonProperty("className") + private String className = null; + + @JsonProperty("color") + private String color = "red"; + @JsonProperty("declawed") private Boolean declawed = null; + + public Cat className(String className) { + this.className = className; + return this; + } + + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Cat color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; } - /** - * Get declawed - * @return declawed + + /** + * Get declawed + * @return declawed **/ @ApiModelProperty(value = "") public Boolean isDeclawed() { return declawed; } - public void setDeclawed(Boolean declawed) { this.declawed = declawed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -57,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && + return Objects.equals(this.className, cat.className) && + Objects.equals(this.color, cat.color) && + Objects.equals(this.declawed, cat.declawed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(declawed, super.hashCode()); + return Objects.hash(className, color, declawed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); sb.append("}"); return sb.toString(); @@ -88,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Category.java index 464f4375c4b..5ef89bf53cf 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Category.java @@ -25,49 +25,49 @@ */ public class Category { + @JsonProperty("id") private Long id = null; - + @JsonProperty("name") private String name = null; - + public Category id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Category name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -85,8 +85,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -109,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ClassModel.java index 4f764fde68d..887733b7310 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ClassModel.java @@ -22,32 +22,31 @@ /** * Model for testing model with \"_class\" property - */ -@ApiModel(description = "Model for testing model with \"_class\" property") + */@ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { + @JsonProperty("_class") private String propertyClass = null; - + public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,8 +63,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -87,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Client.java index a7c4253499c..6193700c6ca 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Client.java @@ -25,28 +25,28 @@ */ public class Client { + @JsonProperty("client") private String client = null; - + public Client client(String client) { this.client = client; return this; } - /** - * Get client - * @return client + + /** + * Get client + * @return client **/ @ApiModelProperty(value = "") public String getClient() { return client; } - public void setClient(String client) { this.client = client; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,8 +63,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(client); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -86,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Dog.java index 7de179b2ade..bffa0917362 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Dog.java @@ -26,28 +26,70 @@ */ public class Dog extends Animal { + + @JsonProperty("className") + private String className = null; + + @JsonProperty("color") + private String color = "red"; + @JsonProperty("breed") private String breed = null; + + public Dog className(String className) { + this.className = className; + return this; + } + + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Dog color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Dog breed(String breed) { this.breed = breed; return this; } - /** - * Get breed - * @return breed + + /** + * Get breed + * @return breed **/ @ApiModelProperty(value = "") public String getBreed() { return breed; } - public void setBreed(String breed) { this.breed = breed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -57,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && + return Objects.equals(this.className, dog.className) && + Objects.equals(this.color, dog.color) && + Objects.equals(this.breed, dog.breed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(breed, super.hashCode()); + return Objects.hash(className, color, breed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); sb.append("}"); return sb.toString(); @@ -88,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumArrays.java index 12caa480285..e23a220e753 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumArrays.java @@ -27,12 +27,13 @@ */ public class EnumArrays { - /** + + /** * Gets or Sets justSymbol */ public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), + GREATER_THAN_OR_EQUAL_TO(">="), DOLLAR("$"); private String value; @@ -40,8 +41,9 @@ public enum JustSymbolEnum { JustSymbolEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -50,8 +52,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static JustSymbolEnum fromValue(String text) { for (JustSymbolEnum b : JustSymbolEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -60,17 +63,20 @@ public static JustSymbolEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("just_symbol") private JustSymbolEnum justSymbol = null; - - /** + + + /** * Gets or Sets arrayEnum */ public enum ArrayEnumEnum { - FISH("fish"), + FISH("fish"), CRAB("crab"); private String value; @@ -78,8 +84,9 @@ public enum ArrayEnumEnum { ArrayEnumEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -88,8 +95,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static ArrayEnumEnum fromValue(String text) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -98,56 +106,57 @@ public static ArrayEnumEnum fromValue(String text) { } return null; } + } - + @JsonProperty("array_enum") private List arrayEnum = null; - + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; return this; } - /** - * Get justSymbol - * @return justSymbol + + /** + * Get justSymbol + * @return justSymbol **/ @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } - public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } - + public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; return this; } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { this.arrayEnum = new ArrayList(); } + this.arrayEnum.add(arrayEnumItem); return this; } - - /** - * Get arrayEnum - * @return arrayEnum + + /** + * Get arrayEnum + * @return arrayEnum **/ @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } - public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -165,8 +174,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -189,5 +197,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumClass.java index abbd7a56668..9414211ef6c 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumClass.java @@ -13,14 +13,17 @@ package io.swagger.client.model; -import java.util.Objects; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + + /** * Gets or Sets EnumClass */ + public enum EnumClass { _ABC("_abc"), @@ -35,7 +38,9 @@ public enum EnumClass { this.value = value; } + @JsonValue + public String getValue() { return value; } @@ -45,7 +50,9 @@ public String toString() { return String.valueOf(value); } + @JsonCreator + public static EnumClass fromValue(String text) { for (EnumClass b : EnumClass.values()) { if (String.valueOf(b.value).equals(text)) { @@ -54,5 +61,8 @@ public static EnumClass fromValue(String text) { } return null; } + } + + 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 93d0da037b6..4634e7018db 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 @@ -26,14 +26,14 @@ */ public class EnumTest { - /** + + /** * Gets or Sets enumString */ public enum EnumStringEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"), - EMPTY(""); private String value; @@ -41,8 +41,9 @@ public enum EnumStringEnum { EnumStringEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -51,8 +52,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumStringEnum fromValue(String text) { for (EnumStringEnum b : EnumStringEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -61,17 +63,19 @@ public static EnumStringEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_string") private EnumStringEnum enumString = null; - - /** + + /** * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(1), NUMBER_MINUS_1(-1); private Integer value; @@ -79,8 +83,9 @@ public enum EnumIntegerEnum { EnumIntegerEnum(Integer value) { this.value = value; } - + @JsonValue + public Integer getValue() { return value; } @@ -89,8 +94,9 @@ public Integer getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumIntegerEnum fromValue(String text) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -99,17 +105,19 @@ public static EnumIntegerEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger = null; - - /** + + /** * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(1.1), NUMBER_MINUS_1_DOT_2(-1.2); private Double value; @@ -117,8 +125,9 @@ public enum EnumNumberEnum { EnumNumberEnum(Double value) { this.value = value; } - + @JsonValue + public Double getValue() { return value; } @@ -127,8 +136,9 @@ public Double getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumNumberEnum fromValue(String text) { for (EnumNumberEnum b : EnumNumberEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -137,87 +147,88 @@ public static EnumNumberEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_number") private EnumNumberEnum enumNumber = null; - + @JsonProperty("outerEnum") private OuterEnum outerEnum = null; - + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; } - /** - * Get enumString - * @return enumString + + /** + * Get enumString + * @return enumString **/ @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } - public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } - + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; } - /** - * Get enumInteger - * @return enumInteger + + /** + * Get enumInteger + * @return enumInteger **/ @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } - public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } - + public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; return this; } - /** - * Get enumNumber - * @return enumNumber + + /** + * Get enumNumber + * @return enumNumber **/ @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } - public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - + public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; return this; } - /** - * Get outerEnum - * @return outerEnum + + /** + * Get outerEnum + * @return outerEnum **/ @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -237,8 +248,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -263,5 +273,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\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 4118656d29e..df02f3998d4 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 @@ -29,290 +29,284 @@ */ public class FormatTest { + @JsonProperty("integer") private Integer integer = null; - + @JsonProperty("int32") private Integer int32 = null; - + @JsonProperty("int64") private Long int64 = null; - + @JsonProperty("number") private BigDecimal number = null; - + @JsonProperty("float") private Float _float = null; - + @JsonProperty("double") private Double _double = null; - + @JsonProperty("string") private String string = null; - + @JsonProperty("byte") - private byte[] _byte = null; - + private String _byte = null; + @JsonProperty("binary") - private byte[] binary = null; - + private String binary = null; + @JsonProperty("date") private LocalDate date = null; - + @JsonProperty("dateTime") private OffsetDateTime dateTime = null; - + @JsonProperty("uuid") private UUID uuid = null; - + @JsonProperty("password") private String password = null; - + public FormatTest integer(Integer integer) { this.integer = integer; return this; } - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer **/ @ApiModelProperty(value = "") public Integer getInteger() { return integer; } - public void setInteger(Integer integer) { this.integer = integer; } - + public FormatTest int32(Integer int32) { this.int32 = int32; return this; } - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 **/ @ApiModelProperty(value = "") public Integer getInt32() { return int32; } - public void setInt32(Integer int32) { this.int32 = int32; } - + public FormatTest int64(Long int64) { this.int64 = int64; return this; } - /** - * Get int64 - * @return int64 + + /** + * Get int64 + * @return int64 **/ @ApiModelProperty(value = "") public Long getInt64() { return int64; } - public void setInt64(Long int64) { this.int64 = int64; } - + public FormatTest number(BigDecimal number) { this.number = number; return this; } - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number + + /** + * Get number + * @return number **/ @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } - public void setNumber(BigDecimal number) { this.number = number; } - + public FormatTest _float(Float _float) { this._float = _float; return this; } - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float + + /** + * Get _float + * @return _float **/ @ApiModelProperty(value = "") public Float getFloat() { return _float; } - public void setFloat(Float _float) { this._float = _float; } - + public FormatTest _double(Double _double) { this._double = _double; return this; } - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double + + /** + * Get _double + * @return _double **/ @ApiModelProperty(value = "") public Double getDouble() { return _double; } - public void setDouble(Double _double) { this._double = _double; } - + public FormatTest string(String string) { this.string = string; return this; } - /** - * Get string - * @return string + + /** + * Get string + * @return string **/ @ApiModelProperty(value = "") public String getString() { return string; } - public void setString(String string) { this.string = string; } - - public FormatTest _byte(byte[] _byte) { + + public FormatTest _byte(String _byte) { this._byte = _byte; return this; } - /** - * Get _byte - * @return _byte + + /** + * Get _byte + * @return _byte **/ @ApiModelProperty(required = true, value = "") - public byte[] getByte() { + public String getByte() { return _byte; } - - public void setByte(byte[] _byte) { + public void setByte(String _byte) { this._byte = _byte; } - - public FormatTest binary(byte[] binary) { + + public FormatTest binary(String binary) { this.binary = binary; return this; } - /** - * Get binary - * @return binary + + /** + * Get binary + * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public String getBinary() { return binary; } - - public void setBinary(byte[] binary) { + public void setBinary(String binary) { this.binary = binary; } - + public FormatTest date(LocalDate date) { this.date = date; return this; } - /** - * Get date - * @return date + + /** + * Get date + * @return date **/ @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } - public void setDate(LocalDate date) { this.date = date; } - + public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public FormatTest password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -341,8 +335,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -376,5 +369,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 6dc9f12c4b8..98a721fb9dc 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -25,31 +25,33 @@ */ public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar = null; - + @JsonProperty("foo") private String foo = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - - /** - * Get foo - * @return foo + + + /** + * Get foo + * @return foo **/ @ApiModelProperty(value = "") public String getFoo() { return foo; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,8 +69,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, foo); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -91,5 +92,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/MapTest.java index e6344a1df0f..90ed39f7e3f 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/MapTest.java @@ -28,15 +28,17 @@ */ public class MapTest { + @JsonProperty("map_map_of_string") private Map> mapMapOfString = null; - - /** + + + /** * Gets or Sets inner */ public enum InnerEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"); private String value; @@ -44,8 +46,9 @@ public enum InnerEnum { InnerEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -54,8 +57,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static InnerEnum fromValue(String text) { for (InnerEnum b : InnerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -64,64 +68,64 @@ public static InnerEnum fromValue(String text) { } return null; } + } - + @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; - + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { this.mapMapOfString = new HashMap>(); } + this.mapMapOfString.put(key, mapMapOfStringItem); return this; } - - /** - * Get mapMapOfString - * @return mapMapOfString + /** + * Get mapMapOfString + * @return mapMapOfString **/ @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } - public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } - + public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; return this; } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { this.mapOfEnumString = new HashMap(); } + this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } - - /** - * Get mapOfEnumString - * @return mapOfEnumString + /** + * Get mapOfEnumString + * @return mapOfEnumString **/ @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } - public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -139,8 +143,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -163,5 +166,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 29bfc7e8c08..4a8b69780fd 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -31,78 +31,78 @@ */ public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid = null; - + @JsonProperty("dateTime") private OffsetDateTime dateTime = null; - + @JsonProperty("map") private Map map = null; - + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; return this; } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { this.map = new HashMap(); } + this.map.put(key, mapItem); return this; } - - /** - * Get map - * @return map + /** + * Get map + * @return map **/ @ApiModelProperty(value = "") public Map getMap() { return map; } - public void setMap(Map map) { this.map = map; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -121,8 +121,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(uuid, dateTime, map); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -146,5 +145,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 58624475e43..606b051c2ea 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 @@ -22,53 +22,52 @@ /** * Model for testing model name starting with number - */ -@ApiModel(description = "Model for testing model name starting with number") + */@ApiModel(description = "Model for testing model name starting with number") public class Model200Response { + @JsonProperty("name") private Integer name = null; - + @JsonProperty("class") private String propertyClass = null; - + public Model200Response name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - + public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -86,8 +85,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -110,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelApiResponse.java index b010e53b48c..4002f3f632e 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -25,70 +25,70 @@ */ public class ModelApiResponse { + @JsonProperty("code") private Integer code = null; - + @JsonProperty("type") private String type = null; - + @JsonProperty("message") private String message = null; - + public ModelApiResponse code(Integer code) { this.code = code; return this; } - /** - * Get code - * @return code + + /** + * Get code + * @return code **/ @ApiModelProperty(value = "") public Integer getCode() { return code; } - public void setCode(Integer code) { this.code = code; } - + public ModelApiResponse type(String type) { this.type = type; return this; } - /** - * Get type - * @return type + + /** + * Get type + * @return type **/ @ApiModelProperty(value = "") public String getType() { return type; } - public void setType(String type) { this.type = type; } - + public ModelApiResponse message(String message) { this.message = message; return this; } - /** - * Get message - * @return message + + /** + * Get message + * @return message **/ @ApiModelProperty(value = "") public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -107,8 +107,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(code, type, message); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -132,5 +131,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelReturn.java index 27d08557248..685e5ba93ac 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelReturn.java @@ -22,32 +22,31 @@ /** * Model for testing reserved words - */ -@ApiModel(description = "Model for testing reserved words") + */@ApiModel(description = "Model for testing reserved words") public class ModelReturn { + @JsonProperty("return") private Integer _return = null; - + public ModelReturn _return(Integer _return) { this._return = _return; return this; } - /** - * Get _return - * @return _return + + /** + * Get _return + * @return _return **/ @ApiModelProperty(value = "") public Integer getReturn() { return _return; } - public void setReturn(Integer _return) { this._return = _return; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,8 +63,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(_return); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -87,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 f2b9b1703bd..7c94ab233c2 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 @@ -22,77 +22,78 @@ /** * Model for testing model name same as property name - */ -@ApiModel(description = "Model for testing model name same as property name") + */@ApiModel(description = "Model for testing model name same as property name") public class Name { + @JsonProperty("name") private Integer name = null; - + @JsonProperty("snake_case") private Integer snakeCase = null; - + @JsonProperty("property") private String property = null; - + @JsonProperty("123Number") private Integer _123Number = null; - + public Name name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - - /** - * Get snakeCase - * @return snakeCase + + + /** + * Get snakeCase + * @return snakeCase **/ @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } - + public Name property(String property) { this.property = property; return this; } - /** - * Get property - * @return property + + /** + * Get property + * @return property **/ @ApiModelProperty(value = "") public String getProperty() { return property; } - public void setProperty(String property) { this.property = property; } - - /** - * Get _123Number - * @return _123Number + + + /** + * Get _123Number + * @return _123Number **/ @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,8 +113,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, snakeCase, property, _123Number); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -138,5 +138,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/NumberOnly.java index ec93aba0531..dc53f9e50dc 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/NumberOnly.java @@ -26,28 +26,28 @@ */ public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber = null; - + public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; return this; } - /** - * Get justNumber - * @return justNumber + + /** + * Get justNumber + * @return justNumber **/ @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } - public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,8 +64,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -87,5 +86,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Order.java index 6976ceb8fba..0a6d7ad0933 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Order.java @@ -26,26 +26,26 @@ */ public class Order { + @JsonProperty("id") private Long id = null; - + @JsonProperty("petId") private Long petId = null; - + @JsonProperty("quantity") private Integer quantity = null; - + @JsonProperty("shipDate") private OffsetDateTime shipDate = null; - - /** + + /** * Order Status */ public enum StatusEnum { - PLACED("placed"), + PLACED("placed"), APPROVED("approved"), - DELIVERED("delivered"); private String value; @@ -53,8 +53,9 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -63,8 +64,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -73,123 +75,124 @@ public static StatusEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("status") private StatusEnum status = null; - + @JsonProperty("complete") private Boolean complete = false; - + public Order id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Order petId(Long petId) { this.petId = petId; return this; } - /** - * Get petId - * @return petId + + /** + * Get petId + * @return petId **/ @ApiModelProperty(value = "") public Long getPetId() { return petId; } - public void setPetId(Long petId) { this.petId = petId; } - + public Order quantity(Integer quantity) { this.quantity = quantity; return this; } - /** - * Get quantity - * @return quantity + + /** + * Get quantity + * @return quantity **/ @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } - public void setQuantity(Integer quantity) { this.quantity = quantity; } - + public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; return this; } - /** - * Get shipDate - * @return shipDate + + /** + * Get shipDate + * @return shipDate **/ @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } - public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } - + public Order status(StatusEnum status) { this.status = status; return this; } - /** - * Order Status - * @return status + + /** + * Order Status + * @return status **/ @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - + public Order complete(Boolean complete) { this.complete = complete; return this; } - /** - * Get complete - * @return complete + + /** + * Get complete + * @return complete **/ @ApiModelProperty(value = "") public Boolean isComplete() { return complete; } - public void setComplete(Boolean complete) { this.complete = complete; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -211,8 +214,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -239,5 +241,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterComposite.java index 02c16a99b70..8b957f45a14 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterComposite.java @@ -26,70 +26,70 @@ */ public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber = null; - + @JsonProperty("my_string") private String myString = null; - + @JsonProperty("my_boolean") private Boolean myBoolean = null; - + public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; return this; } - /** - * Get myNumber - * @return myNumber + + /** + * Get myNumber + * @return myNumber **/ @ApiModelProperty(value = "") public BigDecimal getMyNumber() { return myNumber; } - public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } - + public OuterComposite myString(String myString) { this.myString = myString; return this; } - /** - * Get myString - * @return myString + + /** + * Get myString + * @return myString **/ @ApiModelProperty(value = "") public String getMyString() { return myString; } - public void setMyString(String myString) { this.myString = myString; } - + public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; return this; } - /** - * Get myBoolean - * @return myBoolean + + /** + * Get myBoolean + * @return myBoolean **/ @ApiModelProperty(value = "") public Boolean getMyBoolean() { return myBoolean; } - public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -108,8 +108,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(myNumber, myString, myBoolean); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -133,5 +132,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterEnum.java index 948d80c2e6d..3390d473c7b 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterEnum.java @@ -13,14 +13,17 @@ package io.swagger.client.model; -import java.util.Objects; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + + /** * Gets or Sets OuterEnum */ + public enum OuterEnum { PLACED("placed"), @@ -35,7 +38,9 @@ public enum OuterEnum { this.value = value; } + @JsonValue + public String getValue() { return value; } @@ -45,7 +50,9 @@ public String toString() { return String.valueOf(value); } + @JsonCreator + public static OuterEnum fromValue(String text) { for (OuterEnum b : OuterEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -54,5 +61,8 @@ public static OuterEnum fromValue(String text) { } return null; } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Pet.java index 4c351dec3e4..ab51be3365d 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Pet.java @@ -29,29 +29,29 @@ */ public class Pet { + @JsonProperty("id") private Long id = null; - + @JsonProperty("category") private Category category = null; - + @JsonProperty("name") private String name = null; - + @JsonProperty("photoUrls") private List photoUrls = new ArrayList(); - + @JsonProperty("tags") private List tags = null; - - /** + + /** * pet status in the store */ public enum StatusEnum { - AVAILABLE("available"), + AVAILABLE("available"), PENDING("pending"), - SOLD("sold"); private String value; @@ -59,8 +59,9 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -69,8 +70,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -79,133 +81,135 @@ public static StatusEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("status") private StatusEnum status = null; - + public Pet id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Pet category(Category category) { this.category = category; return this; } - /** - * Get category - * @return category + + /** + * Get category + * @return category **/ @ApiModelProperty(value = "") public Category getCategory() { return category; } - public void setCategory(Category category) { this.category = category; } - + public Pet name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - + public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); return this; } - - /** - * Get photoUrls - * @return photoUrls + + /** + * Get photoUrls + * @return photoUrls **/ @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } - + public Pet tags(List tags) { this.tags = tags; return this; } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { this.tags = new ArrayList(); } + this.tags.add(tagsItem); return this; } - - /** - * Get tags - * @return tags + + /** + * Get tags + * @return tags **/ @ApiModelProperty(value = "") public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } - + public Pet status(StatusEnum status) { this.status = status; return this; } - /** - * pet status in the store - * @return status + + /** + * pet status in the store + * @return status **/ @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -227,8 +231,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -255,5 +258,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 76f8a912f36..1532a30b9e9 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -25,40 +25,41 @@ */ public class ReadOnlyFirst { + @JsonProperty("bar") private String bar = null; - + @JsonProperty("baz") private String baz = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; } - /** - * Get baz - * @return baz + + /** + * Get baz + * @return baz **/ @ApiModelProperty(value = "") public String getBaz() { return baz; } - public void setBaz(String baz) { this.baz = baz; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -76,8 +77,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, baz); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,5 +100,8 @@ private String toIndentedString(java.lang.Object o) { 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 784eb8baca8..38b54fd6c38 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 @@ -25,28 +25,28 @@ */ public class SpecialModelName { - @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + @JsonProperty("$special[property.name]") + private Long $specialPropertyName = null; + + 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; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -55,22 +55,21 @@ public boolean equals(java.lang.Object o) { 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); } - - + @Override public String toString() { 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(); } @@ -86,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Tag.java index 1cf2f5bc5e6..2967322b174 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Tag.java @@ -25,49 +25,49 @@ */ public class Tag { + @JsonProperty("id") private Long id = null; - + @JsonProperty("name") private String name = null; - + public Tag id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Tag name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -85,8 +85,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -109,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/User.java index de5bc439c5a..cb2f9f34084 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/User.java @@ -25,175 +25,175 @@ */ public class User { + @JsonProperty("id") private Long id = null; - + @JsonProperty("username") private String username = null; - + @JsonProperty("firstName") private String firstName = null; - + @JsonProperty("lastName") private String lastName = null; - + @JsonProperty("email") private String email = null; - + @JsonProperty("password") private String password = null; - + @JsonProperty("phone") private String phone = null; - + @JsonProperty("userStatus") private Integer userStatus = null; - + public User id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public User username(String username) { this.username = username; return this; } - /** - * Get username - * @return username + + /** + * Get username + * @return username **/ @ApiModelProperty(value = "") public String getUsername() { return username; } - public void setUsername(String username) { this.username = username; } - + public User firstName(String firstName) { this.firstName = firstName; return this; } - /** - * Get firstName - * @return firstName + + /** + * Get firstName + * @return firstName **/ @ApiModelProperty(value = "") public String getFirstName() { return firstName; } - public void setFirstName(String firstName) { this.firstName = firstName; } - + public User lastName(String lastName) { this.lastName = lastName; return this; } - /** - * Get lastName - * @return lastName + + /** + * Get lastName + * @return lastName **/ @ApiModelProperty(value = "") public String getLastName() { return lastName; } - public void setLastName(String lastName) { this.lastName = lastName; } - + public User email(String email) { this.email = email; return this; } - /** - * Get email - * @return email + + /** + * Get email + * @return email **/ @ApiModelProperty(value = "") public String getEmail() { return email; } - public void setEmail(String email) { this.email = email; } - + public User password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - + public User phone(String phone) { this.phone = phone; return this; } - /** - * Get phone - * @return phone + + /** + * Get phone + * @return phone **/ @ApiModelProperty(value = "") public String getPhone() { return phone; } - public void setPhone(String phone) { this.phone = phone; } - + public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; } - /** - * User Status - * @return userStatus + + /** + * User Status + * @return userStatus **/ @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } - public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -217,8 +217,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -247,5 +246,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..f2b031f9485 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 @@ -15,14 +15,17 @@ import io.swagger.client.ApiException; import io.swagger.client.model.Client; + 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 AnotherFakeApi */ @@ -42,8 +45,10 @@ 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..9710cbe6764 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,17 +16,18 @@ import io.swagger.client.ApiException; 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 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 FakeApi */ @@ -46,7 +47,9 @@ public class FakeApiTest { */ @Test public void fakeOuterBooleanSerializeTest() throws ApiException { + Boolean body = null; + Boolean response = api.fakeOuterBooleanSerialize(body); // TODO: test validations @@ -62,8 +65,10 @@ public void fakeOuterBooleanSerializeTest() throws ApiException { */ @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 } @@ -78,7 +83,9 @@ public void fakeOuterCompositeSerializeTest() throws ApiException { */ @Test public void fakeOuterNumberSerializeTest() throws ApiException { + BigDecimal body = null; + BigDecimal response = api.fakeOuterNumberSerialize(body); // TODO: test validations @@ -94,7 +101,9 @@ public void fakeOuterNumberSerializeTest() throws ApiException { */ @Test public void fakeOuterStringSerializeTest() throws ApiException { + String body = null; + String response = api.fakeOuterStringSerialize(body); // TODO: test validations @@ -110,8 +119,10 @@ public void fakeOuterStringSerializeTest() throws ApiException { */ @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 } @@ -126,21 +137,10 @@ public void testClientModelTest() throws ApiException { */ @Test public void testEndpointParametersTest() throws ApiException { - BigDecimal number = null; - Double _double = null; - String patternWithoutDelimiter = null; - byte[] _byte = null; - Integer integer = null; - Integer int32 = null; - Long int64 = null; - Float _float = null; - String string = null; - byte[] binary = null; - LocalDate date = null; - OffsetDateTime dateTime = null; - String password = null; - String paramCallback = null; - api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + + Object body = null; + + api.testEndpointParameters(body); // TODO: test validations } @@ -155,15 +155,38 @@ public void testEndpointParametersTest() throws ApiException { */ @Test public void testEnumParametersTest() throws ApiException { - List enumFormStringArray = null; - String enumFormString = null; + + Object body = 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); + + api.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); + + // TODO: test validations + } + + /** + * test inline additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineAdditionalPropertiesTest() throws ApiException { + + Map body = null; + + api.testInlineAdditionalProperties(body); // TODO: test validations } @@ -178,9 +201,10 @@ public void testEnumParametersTest() throws ApiException { */ @Test public void testJsonFormDataTest() throws ApiException { - String param = null; - String param2 = null; - api.testJsonFormData(param, param2); + + Object body = null; + + api.testJsonFormData(body); // 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..dbda3faa692 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 @@ -15,14 +15,17 @@ import io.swagger.client.ApiException; import io.swagger.client.model.Client; + 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 FakeClassnameTags123Api */ @@ -42,8 +45,10 @@ 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/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 ced6e945d99..f02c13872eb 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,189 @@ -/* - * 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 - * - * Muliple 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 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 { + + Integer 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 { + + Integer 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 { + + Integer petId = null; + + Object body = null; + + api.updatePetWithForm(petId, body); + + // TODO: test validations + } + + /** + * uploads an image + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void uploadFileTest() throws ApiException { + + Integer petId = null; + + Object body = null; + + ModelApiResponse response = api.uploadFile(petId, body); + + // 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..c6d9b89f0bd 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,108 @@ -/* - * 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 { + + Integer 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..175f42fca9c 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,184 @@ -/* - * 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 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 { + + User user = null; + + String username = null; + + api.updateUser(user, username); + + // TODO: test validations + } + +} diff --git a/samples/client/petstore/java/resttemplate-withXml/.swagger-codegen/VERSION b/samples/client/petstore/java/resttemplate-withXml/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/client/petstore/java/resttemplate-withXml/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/resttemplate-withXml/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate-withXml/README.md b/samples/client/petstore/java/resttemplate-withXml/README.md index 6435fa1c756..052614ff843 100644 --- a/samples/client/petstore/java/resttemplate-withXml/README.md +++ b/samples/client/petstore/java/resttemplate-withXml/README.md @@ -1,4 +1,4 @@ -# swagger-petstore-resttemplate +# swagger-pestore-resttemplate-withxml ## Requirements @@ -27,7 +27,7 @@ Add this dependency to your project's POM: ```xml io.swagger - swagger-petstore-resttemplate + swagger-pestore-resttemplate-withxml 1.0.0 compile @@ -38,7 +38,7 @@ 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 "io.swagger:swagger-pestore-resttemplate-withxml:1.0.0" ``` ### Others @@ -49,7 +49,7 @@ At first generate the JAR by executing: Then manually install the following JARs: -* target/swagger-petstore-resttemplate-1.0.0.jar +* target/swagger-pestore-resttemplate-withxml-1.0.0.jar * target/lib/*.jar ## Getting Started @@ -61,22 +61,27 @@ 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) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + + + AnotherFakeApi apiInstance = new AnotherFakeApi(); + + Client client = ; // Client | client model - FakeApi apiInstance = new FakeApi(); - Boolean body = true; // Boolean | Input boolean as post body 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,6 +95,7 @@ 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 | @@ -97,6 +103,9 @@ Class | Method | HTTP request | Description *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 @@ -123,14 +132,15 @@ Class | Method | HTTP request | Description - [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) @@ -151,8 +161,6 @@ Class | Method | HTTP request | Description - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) - - [Cat](docs/Cat.md) - - [Dog](docs/Dog.md) ## Documentation for Authorization @@ -164,18 +172,37 @@ 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 - **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 diff --git a/samples/client/petstore/java/resttemplate-withXml/build.gradle b/samples/client/petstore/java/resttemplate-withXml/build.gradle index 791446fcbf7..3287695a76c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/build.gradle +++ b/samples/client/petstore/java/resttemplate-withXml/build.gradle @@ -32,8 +32,11 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 22 } compileOptions { + + sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 + } // Rename the aar correctly @@ -78,8 +81,11 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven' + + sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 + install { repositories.mavenInstaller { @@ -99,7 +105,9 @@ ext { spring_web_version = "4.3.9.RELEASE" jodatime_version = "2.9.9" junit_version = "4.12" + jackson_threeten_version = "2.6.4" + } dependencies { @@ -109,7 +117,13 @@ 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_threeten_version" + + compile "com.fasterxml.jackson.dataformat:jackson-dataformat-xml:$jackson_version" + testCompile "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/resttemplate-withXml/docs/AdditionalPropertiesClass.md index 0437c4dd8cc..b37862da7cf 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/AdditionalPropertiesClass.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/Animal.md b/samples/client/petstore/java/resttemplate-withXml/docs/Animal.md index b3f325c3524..346caaf63f4 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/Animal.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/Animal.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/AnimalFarm.md b/samples/client/petstore/java/resttemplate-withXml/docs/AnimalFarm.md deleted file mode 100644 index c7c7f1ddcce..00000000000 --- a/samples/client/petstore/java/resttemplate-withXml/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ - -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/AnotherFakeApi.md b/samples/client/petstore/java/resttemplate-withXml/docs/AnotherFakeApi.md index 7a04619aaba..fb5c988e6cc 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/AnotherFakeApi.md @@ -7,9 +7,11 @@ Method | HTTP request | Description [**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -22,10 +24,13 @@ To test special tags //import io.swagger.client.api.AnotherFakeApi; + AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +42,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -52,3 +58,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/resttemplate-withXml/docs/ArrayOfArrayOfNumberOnly.md index 77292549927..3671a5e9190 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/ArrayOfArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/resttemplate-withXml/docs/ArrayOfNumberOnly.md index e8cc4cd36dc..30b9b6648f4 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/ArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/ArrayTest.md b/samples/client/petstore/java/resttemplate-withXml/docs/ArrayTest.md index 9feee16427f..4ab76343030 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/ArrayTest.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/ArrayTest.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/Capitalization.md b/samples/client/petstore/java/resttemplate-withXml/docs/Capitalization.md index 0f3064c1996..9af7864f97e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/Capitalization.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/Capitalization.md @@ -13,3 +13,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/Cat.md b/samples/client/petstore/java/resttemplate-withXml/docs/Cat.md index 6e9f71ce7dd..5e408344021 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/Cat.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/Cat.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **declawed** | **Boolean** | | [optional] + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/Category.md b/samples/client/petstore/java/resttemplate-withXml/docs/Category.md index e2df0803278..deb5a3e2a52 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/Category.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/Category.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/ClassModel.md b/samples/client/petstore/java/resttemplate-withXml/docs/ClassModel.md index 64f880c8786..49c281cc0ed 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/ClassModel.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/ClassModel.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/Client.md b/samples/client/petstore/java/resttemplate-withXml/docs/Client.md index 5c490ea166c..52b2f72c79c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/Client.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/Client.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/Dog.md b/samples/client/petstore/java/resttemplate-withXml/docs/Dog.md index ac7cea323ff..00e6446e9f5 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/Dog.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/Dog.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **breed** | **String** | | [optional] + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/EnumArrays.md b/samples/client/petstore/java/resttemplate-withXml/docs/EnumArrays.md index 4dddc0bfd27..939a0e69587 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/EnumArrays.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/EnumArrays.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] + ## Enum: JustSymbolEnum Name | Value @@ -20,8 +21,6 @@ DOLLAR | "$" ## Enum: List<ArrayEnumEnum> Name | Value ---- | ----- -FISH | "fish" -CRAB | "crab" diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/EnumTest.md b/samples/client/petstore/java/resttemplate-withXml/docs/EnumTest.md index 08fee344882..9722c621962 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/EnumTest.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/EnumTest.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] + ## Enum: EnumStringEnum 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..6690b870e4e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/FakeApi.md @@ -15,6 +15,8 @@ Method | HTTP request | Description [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data + + # **fakeOuterBooleanSerialize** > Boolean fakeOuterBooleanSerialize(body) @@ -30,8 +32,11 @@ Test serialization of outer boolean types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body + +Boolean body = ; // Boolean | Input boolean as post body + try { Boolean result = apiInstance.fakeOuterBooleanSerialize(body); System.out.println(result); @@ -47,6 +52,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + ### Return type **Boolean** @@ -57,12 +63,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outercomposite) @@ -75,10 +82,13 @@ Test serialization of object with outer number type //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body + +OuterComposite 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 +100,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outercomposite** | [**OuterComposite**](.md)| Input composite as post body | [optional] + ### Return type @@ -102,8 +113,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterNumberSerialize** @@ -120,8 +132,11 @@ Test serialization of outer number types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body + +BigDecimal body = ; // BigDecimal | Input number as post body + try { BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); System.out.println(result); @@ -137,6 +152,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + ### Return type [**BigDecimal**](BigDecimal.md) @@ -147,8 +163,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterStringSerialize** @@ -165,8 +182,11 @@ Test serialization of outer string types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String body = "body_example"; // String | Input string as post body + +String body = ; // String | Input string as post body + try { String result = apiInstance.fakeOuterStringSerialize(body); System.out.println(result); @@ -182,6 +202,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**String**](String.md)| Input string as post body | [optional] + ### Return type **String** @@ -192,12 +213,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -210,10 +232,13 @@ To test \"client\" model //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +250,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -240,9 +266,10 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + # **testEndpointParameters** -> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) +> testEndpointParameters(body) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -251,36 +278,17 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### 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.FakeApi; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure HTTP basic authorization: http_basic_test -HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); -http_basic_test.setUsername("YOUR USERNAME"); -http_basic_test.setPassword("YOUR PASSWORD"); 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 -Integer integer = 56; // Integer | None -Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None -Float _float = 3.4F; // Float | None -String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None -LocalDate date = new LocalDate(); // LocalDate | None -OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None -String password = "password_example"; // String | None -String paramCallback = "paramCallback_example"; // String | None + +Object body = ; // Object | + try { - apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + apiInstance.testEndpointParameters(body); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEndpointParameters"); e.printStackTrace(); @@ -291,20 +299,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **BigDecimal**| None | - **_double** | **Double**| None | - **patternWithoutDelimiter** | **String**| None | - **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] - **int64** | **Long**| None | [optional] - **_float** | **Float**| None | [optional] - **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] - **date** | **LocalDate**| None | [optional] - **dateTime** | **OffsetDateTime**| None | [optional] - **password** | **String**| None | [optional] - **paramCallback** | **String**| None | [optional] + **body** | [**Object**](Object.md)| | + ### Return type @@ -317,11 +313,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 + - **Accept**: Not defined + # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger) To test enum parameters @@ -334,17 +331,23 @@ To test enum parameters //import io.swagger.client.api.FakeApi; + 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) + +Object body = ; // Object | + List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) -String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + +String enumHeaderString = Arrays.asList("enumHeaderString_example"); // 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) + +String enumQueryString = Arrays.asList("enumQueryString_example"); // String | Query parameter enum test (string) + +Integer enumQueryInteger = Arrays.asList(56); // Integer | Query parameter enum test (double) + try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -355,14 +358,13 @@ 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] + **body** | [**Object**](Object.md)| | [optional] + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: ] + **enumHeaderString** | [**String**](.md)| Header parameter enum test (string) | [optional] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: ] + **enumQueryString** | [**String**](.md)| Query parameter enum test (string) | [optional] + **enumQueryInteger** | [**Integer**](.md)| Query parameter enum test (double) | [optional] + ### Return type @@ -375,16 +377,15 @@ No authorization required ### HTTP request headers - **Content-Type**: */* - - **Accept**: */* + - **Accept**: Not defined + # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(body) test inline additionalProperties - - ### Example ```java // Import classes: @@ -392,10 +393,13 @@ test inline additionalProperties //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body + +Map body = ; // Map | request body + try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(body); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); e.printStackTrace(); @@ -406,7 +410,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **body** | [**Map<String, String>**](Map.md)| request body | + ### Return type @@ -421,14 +426,13 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined + # **testJsonFormData** -> testJsonFormData(param, param2) +> testJsonFormData(body) test json serialization of form data - - ### Example ```java // Import classes: @@ -436,11 +440,13 @@ test json serialization of form data //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String param = "param_example"; // String | field1 -String param2 = "param2_example"; // String | field2 + +Object body = ; // Object | + try { - apiInstance.testJsonFormData(param, param2); + apiInstance.testJsonFormData(body); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testJsonFormData"); e.printStackTrace(); @@ -451,8 +457,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **String**| field1 | - **param2** | **String**| field2 | + **body** | [**Object**](Object.md)| | + ### Return type @@ -467,3 +473,5 @@ No authorization required - **Content-Type**: application/json - **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 bc728bfce5b..2bcbbb7908f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/FakeClassnameTags123Api.md @@ -7,33 +7,28 @@ Method | HTTP request | Description [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case ### 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.FakeClassnameTags123Api; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure API key authorization: api_key_query -ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); -api_key_query.setApiKey("YOUR API KEY"); -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model + +Client 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 +40,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -60,3 +56,5 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/FormatTest.md b/samples/client/petstore/java/resttemplate-withXml/docs/FormatTest.md index c7a3acb3cb7..bc11b93cb26 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/FormatTest.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/FormatTest.md @@ -11,8 +11,8 @@ Name | Type | Description | Notes **_float** | **Float** | | [optional] **_double** | **Double** | | [optional] **string** | **String** | | [optional] -**_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**_byte** | **String** | | +**binary** | **String** | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] @@ -20,3 +20,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/resttemplate-withXml/docs/HasOnlyReadOnly.md index c1d0aac5672..5564ddcf28a 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/HasOnlyReadOnly.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/MapTest.md b/samples/client/petstore/java/resttemplate-withXml/docs/MapTest.md index 714a97a40d9..74a6fe8ae70 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/MapTest.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/MapTest.md @@ -8,12 +8,11 @@ Name | Type | Description | Notes **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] + ## Enum: Map<String, InnerEnum> Name | Value ---- | ----- -UPPER | "UPPER" -LOWER | "lower" diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/resttemplate-withXml/docs/MixedPropertiesAndAdditionalPropertiesClass.md index b12e2cd70e6..4507481b5a9 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/Model200Response.md b/samples/client/petstore/java/resttemplate-withXml/docs/Model200Response.md index 5b3a9a0e46d..8d2cc50bb83 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/Model200Response.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/Model200Response.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/ModelApiResponse.md b/samples/client/petstore/java/resttemplate-withXml/docs/ModelApiResponse.md index 3eec8686cc9..06052b202f1 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/ModelApiResponse.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/ModelApiResponse.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/ModelReturn.md b/samples/client/petstore/java/resttemplate-withXml/docs/ModelReturn.md index a679b04953e..a7845ba254b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/ModelReturn.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/ModelReturn.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/Name.md b/samples/client/petstore/java/resttemplate-withXml/docs/Name.md index ce2fb4dee50..a8d6fec9714 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/Name.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/Name.md @@ -11,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/NumberOnly.md b/samples/client/petstore/java/resttemplate-withXml/docs/NumberOnly.md index a3feac7fadc..adfb36a95bb 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/NumberOnly.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/NumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/Order.md b/samples/client/petstore/java/resttemplate-withXml/docs/Order.md index 268c617d1ff..7e4beff6df1 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/Order.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/Order.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/OuterComposite.md b/samples/client/petstore/java/resttemplate-withXml/docs/OuterComposite.md index 3f5a633c998..1963c7a0f73 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/OuterComposite.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/OuterComposite.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/Pet.md b/samples/client/petstore/java/resttemplate-withXml/docs/Pet.md index 5b63109ef92..1492195a58d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/Pet.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/Pet.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/PetApi.md b/samples/client/petstore/java/resttemplate-withXml/docs/PetApi.md index b5fa395947d..4758743434a 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/PetApi.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/PetApi.md @@ -14,33 +14,28 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image + + # **addPet** -> addPet(body) +> addPet(pet) 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 + +Pet 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 +46,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -64,7 +60,8 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **deletePet** @@ -72,26 +69,20 @@ null (empty response body) 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 | + +Integer petId = Arrays.asList(56); // Integer | Pet id to delete + +String apiKey = Arrays.asList("apiKey_example"); // String | + try { apiInstance.deletePet(petId, apiKey); } catch (ApiException e) { @@ -104,8 +95,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | - **apiKey** | **String**| | [optional] + **petId** | [**Integer**](.md)| Pet id to delete | + **apiKey** | [**String**](.md)| | [optional] + ### Return type @@ -118,7 +110,8 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **findPetsByStatus** @@ -131,20 +124,15 @@ 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); @@ -158,7 +146,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: ] + ### Return type @@ -173,6 +162,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **findPetsByTags** > List<Pet> findPetsByTags(tags) @@ -184,20 +174,15 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### 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); @@ -213,6 +198,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | + ### Return type [**List<Pet>**](Pet.md) @@ -226,6 +212,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **getPetById** > Pet getPetById(petId) @@ -237,22 +224,15 @@ 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to return + try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -266,7 +246,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to return | + **petId** | [**Integer**](.md)| ID of pet to return | + ### Return type @@ -281,33 +262,27 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **updatePet** -> updatePet(body) +> updatePet(pet) 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 + +Pet 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 +293,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -331,37 +307,31 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updatePetWithForm** -> updatePetWithForm(petId, name, status) +> updatePetWithForm(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet that needs to be updated + +Object body = ; // Object | + try { - apiInstance.updatePetWithForm(petId, name, status); + apiInstance.updatePetWithForm(petId, body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePetWithForm"); e.printStackTrace(); @@ -372,9 +342,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet that needs to be updated | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -387,37 +357,31 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **uploadFile** -> ModelApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to update + +Object body = ; // Object | + try { - ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); + ModelApiResponse result = apiInstance.uploadFile(petId, body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFile"); @@ -429,9 +393,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet to update | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -446,3 +410,5 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json + + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/ReadOnlyFirst.md b/samples/client/petstore/java/resttemplate-withXml/docs/ReadOnlyFirst.md index 426b7cde95a..57655e5b49e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/ReadOnlyFirst.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/SpecialModelName.md b/samples/client/petstore/java/resttemplate-withXml/docs/SpecialModelName.md index c2c6117c552..f4259d2a73c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/SpecialModelName.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/SpecialModelName.md @@ -4,7 +4,8 @@ ## 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..a4678ee745c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/StoreApi.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/StoreApi.md @@ -10,6 +10,8 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + # **deleteOrder** > deleteOrder(orderId) @@ -25,8 +27,11 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + +String orderId = Arrays.asList("orderId_example"); // String | ID of the order that needs to be deleted + try { apiInstance.deleteOrder(orderId); } catch (ApiException e) { @@ -39,7 +44,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | + **orderId** | [**String**](.md)| ID of the order that needs to be deleted | + ### Return type @@ -52,7 +58,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getInventory** @@ -65,21 +72,13 @@ 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); @@ -92,6 +91,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type **Map<String, Integer>** @@ -105,6 +105,7 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json + # **getOrderById** > Order getOrderById(orderId) @@ -120,8 +121,11 @@ For valid response try integer IDs with value <= 5 or > 10. Other val //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched + +Integer orderId = Arrays.asList(56); // Integer | ID of pet that needs to be fetched + try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +139,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | [**Integer**](.md)| ID of pet that needs to be fetched | + ### Return type @@ -150,14 +155,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -165,10 +169,13 @@ Place an order for a pet //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet + +Order 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 +187,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](.md)| order placed for purchasing the pet | + ### Return type @@ -192,6 +200,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: */* - **Accept**: application/xml, application/json + + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/Tag.md b/samples/client/petstore/java/resttemplate-withXml/docs/Tag.md index de6814b55d5..7a97d4c6812 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/Tag.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/Tag.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/User.md b/samples/client/petstore/java/resttemplate-withXml/docs/User.md index 8b6753dd284..cf7f9ce1312 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/User.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/User.md @@ -15,3 +15,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/UserApi.md b/samples/client/petstore/java/resttemplate-withXml/docs/UserApi.md index 2e6987951c8..e421376ce79 100644 --- a/samples/client/petstore/java/resttemplate-withXml/docs/UserApi.md +++ b/samples/client/petstore/java/resttemplate-withXml/docs/UserApi.md @@ -14,9 +14,11 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + # **createUser** -> createUser(body) +> createUser(user) Create user @@ -29,10 +31,13 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object + +User 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 +48,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](.md)| Created user object | + ### Return type @@ -55,8 +61,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithArrayInput** @@ -64,8 +71,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -73,8 +78,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -89,6 +97,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type null (empty response body) @@ -99,8 +108,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithListInput** @@ -108,8 +118,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -117,8 +125,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { @@ -133,6 +144,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type null (empty response body) @@ -143,8 +155,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **deleteUser** @@ -161,8 +174,11 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be deleted + +String username = Arrays.asList("username_example"); // String | The name that needs to be deleted + try { apiInstance.deleteUser(username); } catch (ApiException e) { @@ -175,7 +191,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | + **username** | [**String**](.md)| The name that needs to be deleted | + ### Return type @@ -188,7 +205,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getUserByName** @@ -196,8 +214,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -205,8 +221,11 @@ Get user by user name //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. + +String username = Arrays.asList("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 +239,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + **username** | [**String**](.md)| The name that needs to be fetched. Use user1 for testing. | + ### Return type @@ -235,14 +255,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **loginUser** > String loginUser(username, password) Logs user into the system - - ### Example ```java // Import classes: @@ -250,9 +269,13 @@ Logs user into the system //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 + +String username = Arrays.asList("username_example"); // String | The user name for login + +String password = Arrays.asList("password_example"); // String | The password for login in clear text + try { String result = apiInstance.loginUser(username, password); System.out.println(result); @@ -266,8 +289,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | + **username** | [**String**](.md)| The user name for login | + **password** | [**String**](.md)| The password for login in clear text | + ### Return type @@ -282,14 +306,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **logoutUser** > logoutUser() Logs out current logged in user session - - ### Example ```java // Import classes: @@ -297,7 +320,9 @@ Logs out current logged in user session //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); + try { apiInstance.logoutUser(); } catch (ApiException e) { @@ -309,6 +334,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type null (empty response body) @@ -320,11 +346,12 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updateUser** -> updateUser(username, body) +> updateUser(user, username) Updated user @@ -337,11 +364,15 @@ This can only be done by the logged in user. //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 + +User user = ; // User | Updated user object + +String username = Arrays.asList("username_example"); // String | name that need to be deleted + try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(user, username); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -352,8 +383,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](.md)| Updated user object | + **username** | [**String**](.md)| name that need to be deleted | + ### Return type @@ -365,6 +397,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + + diff --git a/samples/client/petstore/java/resttemplate-withXml/git_push.sh b/samples/client/petstore/java/resttemplate-withXml/git_push.sh index ae01b182ae9..ed374619b13 100644 --- a/samples/client/petstore/java/resttemplate-withXml/git_push.sh +++ b/samples/client/petstore/java/resttemplate-withXml/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 credential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential 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/resttemplate-withXml/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/resttemplate-withXml/gradle/wrapper/gradle-wrapper.jar index 2c6137b8789..e69de29bb2d 100644 Binary files a/samples/client/petstore/java/resttemplate-withXml/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/resttemplate-withXml/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/resttemplate-withXml/pom.xml b/samples/client/petstore/java/resttemplate-withXml/pom.xml index ae6f86b4665..8358c2a777d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/pom.xml +++ b/samples/client/petstore/java/resttemplate-withXml/pom.xml @@ -1,266 +1,258 @@ - 4.0.0 - io.swagger - swagger-pestore-resttemplate-withxml - jar - swagger-pestore-resttemplate-withxml - 1.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-pestore-resttemplate-withxml + jar + swagger-pestore-resttemplate-withxml + 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 - 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 + - - - 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 - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - 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.2 - - - - jar - test-jar - - - - - - + + + + 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.codehaus.mojo - build-helper-maven-plugin - 1.10 - - - 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.7 - 1.7 - - - - 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 - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + 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.7 + 1.7 + + + + + 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-annotations-version} - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + - - - org.springframework - spring-web - ${spring-web-version} - + + + io.swagger + swagger-annotations + ${swagger-annotations-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.jaxrs - jackson-jaxrs-json-provider - ${jackson-version} - + + + org.springframework + spring-web + ${spring-web-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.jaxrs + jackson-jaxrs-json-provider + ${jackson-version} + + - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - ${jackson-version} - + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson-version} + - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - + + + + + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-threetenbp-version} + + - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.5.15 - 4.3.9.RELEASE - 2.8.9 - 2.6.4 - 1.0.0 - 4.12 - + + + junit + junit + ${junit-version} + test + + + + UTF-8 + 1.5.15 + 4.3.9.RELEASE + 2.8.9 + + + 2.6.4 + + 1.0.0 + 4.12 + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/ApiClient.java index e16a241aaf9..7236a822d3e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/ApiClient.java @@ -1,7 +1,9 @@ package io.swagger.client; + import com.fasterxml.jackson.dataformat.xml.XmlMapper; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -19,9 +21,11 @@ import org.springframework.http.client.ClientHttpRequestExecution; import org.springframework.http.client.ClientHttpRequestInterceptor; import org.springframework.http.client.ClientHttpResponse; + import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.http.converter.xml.MappingJackson2XmlHttpMessageConverter; + import org.springframework.stereotype.Component; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; @@ -29,12 +33,14 @@ import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; + import org.threeten.bp.*; import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter; import com.fasterxml.jackson.databind.ObjectMapper; + import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -114,11 +120,11 @@ protected void init() { setUserAgent("Java-SDK"); // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); - authentications.put("api_key", new ApiKeyAuth("header", "api_key")); - authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); - authentications.put("http_basic_test", new HttpBasicAuth()); - authentications.put("petstore_auth", new OAuth()); + authentications = new HashMap(); + authentications.put("api_key", new ApiKeyAuth("header", "api_key")); + authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); + authentications.put("http_basic_test", new HttpBasicAuth()); + authentications.put("petstore_auth", new OAuth()); // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); } @@ -263,9 +269,6 @@ public ApiClient setUserAgent(String userAgent) { * @return ApiClient this client */ public ApiClient addDefaultHeader(String name, String value) { - if (defaultHeaders.containsKey(name)) { - defaultHeaders.remove(name); - } defaultHeaders.add(name, value); return this; } @@ -317,12 +320,14 @@ public DateFormat getDateFormat() { */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; + for(HttpMessageConverter converter:restTemplate.getMessageConverters()){ if(converter instanceof AbstractJackson2HttpMessageConverter){ ObjectMapper mapper = ((AbstractJackson2HttpMessageConverter)converter).getObjectMapper(); mapper.setDateFormat(dateFormat); } } + return this; } @@ -583,6 +588,7 @@ protected RestTemplate buildRestTemplate() { RestTemplate restTemplate = new RestTemplate(messageConverters); + for(HttpMessageConverter converter:restTemplate.getMessageConverters()){ if(converter instanceof AbstractJackson2HttpMessageConverter){ ObjectMapper mapper = ((AbstractJackson2HttpMessageConverter)converter).getObjectMapper(); @@ -593,6 +599,7 @@ protected RestTemplate buildRestTemplate() { mapper.registerModule(module); } } + // This allows us to read the response more than once - Necessary for debugging. restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(restTemplate.getRequestFactory())); return restTemplate; 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..e4074541d5f 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 @@ -4,6 +4,7 @@ import io.swagger.client.model.Client; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -25,6 +26,7 @@ @Component("io.swagger.client.api.AnotherFakeApi") + public class AnotherFakeApi { private ApiClient apiClient; @@ -45,20 +47,22 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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(); @@ -69,11 +73,11 @@ public Client testSpecialTags(Client body) throws RestClientException { final String[] accepts = { "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -81,4 +85,6 @@ public Client testSpecialTags(Client body) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + } + 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..2a1b8946dfb 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,10 +4,9 @@ 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 java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -29,6 +28,7 @@ @Component("io.swagger.client.api.FakeApi") + public class FakeApi { private ApiClient apiClient; @@ -49,6 +49,7 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * * Test serialization of outer boolean types @@ -56,6 +57,7 @@ public void setApiClient(ApiClient apiClient) { * @param body 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; @@ -66,9 +68,13 @@ public Boolean fakeOuterBooleanSerialize(Boolean body) throws RestClientExceptio 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 String[] contentTypes = { + "*/*" + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -76,16 +82,18 @@ public Boolean fakeOuterBooleanSerialize(Boolean body) throws RestClientExceptio ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * * 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,9 +101,13 @@ public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Re 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 String[] contentTypes = { + "*/*" + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -103,6 +115,7 @@ public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Re ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * * Test serialization of outer number types @@ -110,6 +123,7 @@ public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Re * @param body Input number as post body * @return BigDecimal * @throws RestClientException if an error occurs while attempting to invoke the API + */ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws RestClientException { Object postBody = body; @@ -120,9 +134,13 @@ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws RestClientExc 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 String[] contentTypes = { + "*/*" + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -130,6 +148,7 @@ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws RestClientExc ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * * Test serialization of outer string types @@ -137,6 +156,7 @@ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws RestClientExc * @param body Input string as post body * @return String * @throws RestClientException if an error occurs while attempting to invoke the API + */ public String fakeOuterStringSerialize(String body) throws RestClientException { Object postBody = body; @@ -147,9 +167,13 @@ public String fakeOuterStringSerialize(String body) throws RestClientException { 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 String[] contentTypes = { + "*/*" + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -157,20 +181,22 @@ public String fakeOuterStringSerialize(String body) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.POST, 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(); @@ -181,11 +207,11 @@ public Client testClientModel(Client body) throws RestClientException { final String[] accepts = { "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -193,48 +219,22 @@ public Client testClientModel(Client body) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *

400 - Invalid username supplied *

404 - User not found - * @param number None - * @param _double None - * @param patternWithoutDelimiter None - * @param _byte None - * @param integer None - * @param int32 None - * @param int64 None - * @param _float None - * @param string None - * @param binary None - * @param date None - * @param dateTime None - * @param password None - * @param paramCallback None + * @param body The body parameter * @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 { - Object postBody = null; - - // verify the required parameter 'number' is set - if (number == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'number' when calling testEndpointParameters"); - } - - // verify the required parameter '_double' is set - if (_double == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter '_double' when calling testEndpointParameters"); - } - - // verify the required parameter 'patternWithoutDelimiter' is set - if (patternWithoutDelimiter == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); - } + public void testEndpointParameters(Object body) throws RestClientException { + Object postBody = body; - // verify the required parameter '_byte' is set - if (_byte == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter '_byte' when calling testEndpointParameters"); + // verify the required parameter 'body' is set + if (body == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testEndpointParameters"); } String path = UriComponentsBuilder.fromPath("/fake").build().toUriString(); @@ -242,43 +242,12 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - - if (integer != null) - formParams.add("integer", integer); - if (int32 != null) - formParams.add("int32", int32); - if (int64 != null) - formParams.add("int64", int64); - if (number != null) - formParams.add("number", number); - if (_float != null) - formParams.add("float", _float); - if (_double != null) - formParams.add("double", _double); - if (string != null) - formParams.add("string", string); - if (patternWithoutDelimiter != null) - formParams.add("pattern_without_delimiter", patternWithoutDelimiter); - if (_byte != null) - formParams.add("byte", _byte); - if (binary != null) - formParams.add("binary", binary); - if (date != null) - formParams.add("date", date); - if (dateTime != null) - formParams.add("dateTime", dateTime); - if (password != null) - formParams.add("password", password); - 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/xml; charset=utf-8", "application/json; charset=utf-8" + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "http_basic_test" }; @@ -286,23 +255,23 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * To test enum parameters * 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 body The body parameter * @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) * @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 { - Object postBody = null; + public void testEnumParameters(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger) throws RestClientException { + Object postBody = body; String path = UriComponentsBuilder.fromPath("/fake").build().toUriString(); @@ -310,7 +279,7 @@ public void testEnumParameters(List enumFormStringArray, String enumForm final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase()), "enum_query_string_array", enumQueryStringArray)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_string_array", enumQueryStringArray)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_string", enumQueryString)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_integer", enumQueryInteger)); @@ -318,21 +287,12 @@ public void testEnumParameters(List enumFormStringArray, String enumForm headerParams.add("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); if (enumHeaderString != null) headerParams.add("enum_header_string", apiClient.parameterToString(enumHeaderString)); - - if (enumFormStringArray != null) - 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 = { "*/*" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -340,19 +300,21 @@ public void testEnumParameters(List enumFormStringArray, String enumForm ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * test inline additionalProperties * *

200 - successful operation - * @param param request body + * @param body 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(Map body) throws RestClientException { + Object postBody = body; - // 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 'body' is set + if (body == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testInlineAdditionalProperties"); } String path = UriComponentsBuilder.fromPath("/fake/inline-additionalProperties").build().toUriString(); @@ -361,11 +323,11 @@ public void testInlineAdditionalProperties(Object param) throws RestClientExcept 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 = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -373,25 +335,21 @@ public void testInlineAdditionalProperties(Object param) throws RestClientExcept ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * test json serialization of form data * *

200 - successful operation - * @param param field1 - * @param param2 field2 + * @param body The body parameter * @throws RestClientException if an error occurs while attempting to invoke the API + */ - public void testJsonFormData(String param, String param2) throws RestClientException { - Object postBody = null; - - // verify the required parameter 'param' is set - if (param == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param' when calling testJsonFormData"); - } + public void testJsonFormData(Object body) throws RestClientException { + Object postBody = body; - // verify the required parameter 'param2' is set - if (param2 == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param2' when calling testJsonFormData"); + // verify the required parameter 'body' is set + if (body == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testJsonFormData"); } String path = UriComponentsBuilder.fromPath("/fake/jsonFormData").build().toUriString(); @@ -399,17 +357,12 @@ public void testJsonFormData(String param, String param2) throws RestClientExcep final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - - if (param != null) - formParams.add("param", param); - if (param2 != null) - formParams.add("param2", param2); - final String[] accepts = { }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -417,4 +370,6 @@ public void testJsonFormData(String param, String param2) throws RestClientExcep ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + } + 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 59eaddcedbe..07c86b37632 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 @@ -4,6 +4,7 @@ import io.swagger.client.model.Client; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -25,6 +26,7 @@ @Component("io.swagger.client.api.FakeClassnameTags123Api") + public class FakeClassnameTags123Api { private ApiClient apiClient; @@ -45,20 +47,22 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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(); @@ -69,11 +73,11 @@ public Client testClassname(Client body) throws RestClientException { final String[] accepts = { "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "api_key_query" }; @@ -81,4 +85,6 @@ public Client testClassname(Client body) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + } + 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..eda24aaaaa1 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 @@ -2,10 +2,10 @@ import io.swagger.client.ApiClient; -import java.io.File; import io.swagger.client.model.ModelApiResponse; import io.swagger.client.model.Pet; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -27,6 +27,7 @@ @Component("io.swagger.client.api.PetApi") + public class PetApi { private ApiClient apiClient; @@ -47,19 +48,21 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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,13 +71,11 @@ public void addPet(Pet body) throws RestClientException { 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" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; @@ -82,6 +83,7 @@ public void addPet(Pet body) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Deletes a pet * @@ -89,8 +91,9 @@ public void addPet(Pet body) throws RestClientException { * @param petId Pet id to delete * @param apiKey The apiKey parameter * @throws RestClientException if an error occurs while attempting to invoke the API + */ - public void deletePet(Long petId, String apiKey) throws RestClientException { + public void deletePet(Integer petId, String apiKey) throws RestClientException { Object postBody = null; // verify the required parameter 'petId' is set @@ -110,11 +113,9 @@ public void deletePet(Long petId, String apiKey) throws RestClientException { 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 String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; @@ -122,6 +123,7 @@ public void deletePet(Long petId, String apiKey) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -130,6 +132,7 @@ public void deletePet(Long petId, String apiKey) throws RestClientException { * @param status Status values that need to be considered for filter * @return List<Pet> * @throws RestClientException if an error occurs while attempting to invoke the API + */ public List findPetsByStatus(List status) throws RestClientException { Object postBody = null; @@ -145,13 +148,13 @@ public List findPetsByStatus(List status) throws RestClientExceptio final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase()), "status", status)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "status", status)); final String[] accepts = { "application/xml", "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; @@ -159,6 +162,7 @@ public List findPetsByStatus(List status) throws RestClientExceptio ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -167,6 +171,7 @@ public List findPetsByStatus(List status) throws RestClientExceptio * @param tags Tags to filter by * @return List<Pet> * @throws RestClientException if an error occurs while attempting to invoke the API + */ public List findPetsByTags(List tags) throws RestClientException { Object postBody = null; @@ -182,13 +187,13 @@ public List findPetsByTags(List tags) throws RestClientException { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase()), "tags", tags)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "tags", tags)); final String[] accepts = { "application/xml", "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; @@ -196,6 +201,7 @@ public List findPetsByTags(List tags) throws RestClientException { ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Find pet by ID * Returns a single pet @@ -205,8 +211,9 @@ public List findPetsByTags(List tags) throws RestClientException { * @param petId ID of pet to return * @return Pet * @throws RestClientException if an error occurs while attempting to invoke the API + */ - public Pet getPetById(Long petId) throws RestClientException { + public Pet getPetById(Integer petId) throws RestClientException { Object postBody = null; // verify the required parameter 'petId' is set @@ -225,9 +232,9 @@ public Pet getPetById(Long petId) throws RestClientException { final String[] accepts = { "application/xml", "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "api_key" }; @@ -235,21 +242,23 @@ public Pet getPetById(Long petId) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * 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 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,13 +267,11 @@ public void updatePet(Pet body) throws RestClientException { 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" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; @@ -272,17 +279,18 @@ public void updatePet(Pet body) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * 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 - * @param status Updated status of the pet + * @param body The body parameter * @throws RestClientException if an error occurs while attempting to invoke the API + */ - public void updatePetWithForm(Long petId, String name, String status) throws RestClientException { - Object postBody = null; + public void updatePetWithForm(Integer petId, Object body) throws RestClientException { + Object postBody = body; // verify the required parameter 'petId' is set if (petId == null) { @@ -297,19 +305,12 @@ public void updatePetWithForm(Long petId, String name, String status) throws Res final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - - if (name != null) - formParams.add("name", name); - 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" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; @@ -317,18 +318,19 @@ public void updatePetWithForm(Long petId, String name, String status) throws Res ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * uploads an image * *

200 - successful operation * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload + * @param body The body parameter * @return ModelApiResponse * @throws RestClientException if an error occurs while attempting to invoke the API + */ - public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws RestClientException { - Object postBody = null; + public ModelApiResponse uploadFile(Integer petId, Object body) throws RestClientException { + Object postBody = body; // verify the required parameter 'petId' is set if (petId == null) { @@ -343,19 +345,14 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - - if (additionalMetadata != null) - formParams.add("additionalMetadata", additionalMetadata); - if (file != null) - formParams.add("file", new FileSystemResource(file)); final String[] accepts = { "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { "multipart/form-data" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; @@ -363,4 +360,6 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + } + 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..f640e5c8d13 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 @@ -4,6 +4,7 @@ import io.swagger.client.model.Order; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -25,6 +26,7 @@ @Component("io.swagger.client.api.StoreApi") + public class StoreApi { private ApiClient apiClient; @@ -45,6 +47,7 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -52,6 +55,7 @@ public void setApiClient(ApiClient apiClient) { *

404 - Order not found * @param orderId ID of the order that needs to be deleted * @throws RestClientException if an error occurs while attempting to invoke the API + */ public void deleteOrder(String orderId) throws RestClientException { Object postBody = null; @@ -70,11 +74,9 @@ public void deleteOrder(String orderId) throws RestClientException { 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 String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -82,12 +84,14 @@ public void deleteOrder(String orderId) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Returns pet inventories by status * Returns a map of status codes to quantities *

200 - successful operation * @return Map<String, Integer> * @throws RestClientException if an error occurs while attempting to invoke the API + */ public Map getInventory() throws RestClientException { Object postBody = null; @@ -100,9 +104,9 @@ public Map getInventory() throws RestClientException { final String[] accepts = { "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "api_key" }; @@ -110,6 +114,7 @@ public Map getInventory() throws RestClientException { ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -119,8 +124,9 @@ public Map getInventory() throws RestClientException { * @param orderId ID of pet that needs to be fetched * @return Order * @throws RestClientException if an error occurs while attempting to invoke the API + */ - public Order getOrderById(Long orderId) throws RestClientException { + public Order getOrderById(Integer orderId) throws RestClientException { Object postBody = null; // verify the required parameter 'orderId' is set @@ -139,9 +145,9 @@ public Order getOrderById(Long orderId) throws RestClientException { final String[] accepts = { "application/xml", "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -149,21 +155,23 @@ public Order getOrderById(Long orderId) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * 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 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(); @@ -174,9 +182,11 @@ public Order placeOrder(Order body) throws RestClientException { final String[] accepts = { "application/xml", "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] contentTypes = { + "*/*" + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -184,4 +194,6 @@ public Order placeOrder(Order body) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + } + 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 3e2d1ac00af..26157643ea4 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 @@ -4,6 +4,7 @@ import io.swagger.client.model.User; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -25,6 +26,7 @@ @Component("io.swagger.client.api.UserApi") + public class UserApi { private ApiClient apiClient; @@ -45,19 +47,21 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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,11 +70,11 @@ public void createUser(User body) throws RestClientException { 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 String[] contentTypes = { + "*/*" + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -78,12 +82,14 @@ public void createUser(User body) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Creates list of users with given input array * *

0 - successful operation * @param body 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; @@ -99,11 +105,11 @@ public void createUsersWithArrayInput(List body) throws RestClientExceptio 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 String[] contentTypes = { + "*/*" + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -111,12 +117,14 @@ public void createUsersWithArrayInput(List body) throws RestClientExceptio ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Creates list of users with given input array * *

0 - successful operation * @param body 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; @@ -132,11 +140,11 @@ public void createUsersWithListInput(List body) throws RestClientException 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 String[] contentTypes = { + "*/*" + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -144,6 +152,7 @@ public void createUsersWithListInput(List body) throws RestClientException ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Delete user * This can only be done by the logged in user. @@ -151,6 +160,7 @@ public void createUsersWithListInput(List body) throws RestClientException *

404 - User not found * @param username The name that needs to be deleted * @throws RestClientException if an error occurs while attempting to invoke the API + */ public void deleteUser(String username) throws RestClientException { Object postBody = null; @@ -169,11 +179,9 @@ public void deleteUser(String username) throws RestClientException { 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 String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -181,6 +189,7 @@ public void deleteUser(String username) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Get user by user name * @@ -190,6 +199,7 @@ public void deleteUser(String username) throws RestClientException { * @param username The name that needs to be fetched. Use user1 for testing. * @return User * @throws RestClientException if an error occurs while attempting to invoke the API + */ public User getUserByName(String username) throws RestClientException { Object postBody = null; @@ -210,9 +220,9 @@ public User getUserByName(String username) throws RestClientException { final String[] accepts = { "application/xml", "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -220,6 +230,7 @@ public User getUserByName(String username) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Logs user into the system * @@ -229,6 +240,7 @@ public User getUserByName(String username) throws RestClientException { * @param password The password for login in clear text * @return String * @throws RestClientException if an error occurs while attempting to invoke the API + */ public String loginUser(String username, String password) throws RestClientException { Object postBody = null; @@ -254,9 +266,9 @@ public String loginUser(String username, String password) throws RestClientExcep final String[] accepts = { "application/xml", "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -264,11 +276,13 @@ public String loginUser(String username, String password) throws RestClientExcep ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Logs out current logged in user session * *

0 - successful operation * @throws RestClientException if an error occurs while attempting to invoke the API + */ public void logoutUser() throws RestClientException { Object postBody = null; @@ -279,11 +293,9 @@ public void logoutUser() throws RestClientException { 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 String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -291,28 +303,30 @@ public void logoutUser() throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Updated user * This can only be done by the logged in user. *

400 - Invalid user supplied *

404 - User not found + * @param user Updated user object * @param username name that need to be deleted - * @param body 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(User user, String username) throws RestClientException { + Object postBody = user; + + // verify the required parameter 'user' is set + if (user == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'user' when calling updateUser"); + } // 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"); - } - // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("username", username); @@ -322,11 +336,11 @@ public void updateUser(String username, User body) throws RestClientException { 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 String[] contentTypes = { + "*/*" + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -334,4 +348,6 @@ public void updateUser(String username, User body) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + } + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 498232b10f3..9d890b7ad49 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -33,73 +33,73 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "AdditionalPropertiesClass") public class AdditionalPropertiesClass { + @JsonProperty("map_property") - // Is a container wrapped=false - // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= - // items.example= items.type=String - @XmlElement(name = "inner") + + + @XmlElement(name="null") + private Map mapProperty = null; - + @JsonProperty("map_of_map_property") - // Is a container wrapped=false - // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= - // items.example= items.type=Map<String, String> - @XmlElement(name = "inner") + + + @XmlElement(name="inner") + private Map> mapOfMapProperty = null; - + public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; return this; } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { this.mapProperty = new HashMap(); } + this.mapProperty.put(key, mapPropertyItem); return this; } - - /** - * Get mapProperty - * @return mapProperty + /** + * Get mapProperty + * @return mapProperty **/ @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } - public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } - + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; return this; } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { this.mapOfMapProperty = new HashMap>(); } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } - - /** - * Get mapOfMapProperty - * @return mapOfMapProperty + /** + * Get mapOfMapProperty + * @return mapOfMapProperty **/ @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -117,8 +117,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapProperty, mapOfMapProperty); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -141,5 +140,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Animal.java index 8bf17b5aa20..b65db5bfe0e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Animal.java @@ -27,63 +27,67 @@ /** * Animal */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true ) + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Discriminator{propertyName='className', mapping=null}", visible = true ) @JsonSubTypes({ + @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + }) @XmlRootElement(name = "Animal") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Animal") public class Animal { + @JsonProperty("className") @JacksonXmlProperty(localName = "className") - @XmlElement(name = "className") + @XmlElement(name="className") private String className = null; - + @JsonProperty("color") @JacksonXmlProperty(localName = "color") - @XmlElement(name = "color") + @XmlElement(name="color") private String color = "red"; - + public Animal className(String className) { this.className = className; return this; } - /** - * Get className - * @return className + + /** + * Get className + * @return className **/ @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } - public void setClassName(String className) { this.className = className; } - + public Animal color(String color) { this.color = color; return this; } - /** - * Get color - * @return color + + /** + * Get color + * @return color **/ @ApiModelProperty(value = "") public String getColor() { return color; } - public void setColor(String color) { this.color = color; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -101,8 +105,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(className, color); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -125,5 +128,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/AnimalFarm.java deleted file mode 100644 index 4211624eadb..00000000000 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/AnimalFarm.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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 io.swagger.client.model.Animal; -import java.util.ArrayList; -import java.util.List; -import com.fasterxml.jackson.dataformat.xml.annotation.*; -import javax.xml.bind.annotation.*; - -/** - * AnimalFarm - */ - -@XmlRootElement(name = "AnimalFarm") -@XmlAccessorType(XmlAccessType.FIELD) -@JacksonXmlRootElement(localName = "AnimalFarm") -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 3b8060ade59..18d67876e25 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -33,40 +33,41 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "ArrayOfArrayOfNumberOnly") public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") - // Is a container wrapped=false - // items.name=arrayArrayNumber items.baseName=arrayArrayNumber items.xmlName= items.xmlNamespace= - // items.example= items.type=List<BigDecimal> - @XmlElement(name = "arrayArrayNumber") + + + @XmlElement(name="arrayArrayNumber") + private List> arrayArrayNumber = null; - + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; return this; } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { this.arrayArrayNumber = new ArrayList>(); } + this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber **/ @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } - public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -83,8 +84,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayArrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -106,5 +106,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 35ac9d8f82f..0b973b807b7 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -33,40 +33,41 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "ArrayOfNumberOnly") public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") - // Is a container wrapped=false - // items.name=arrayNumber items.baseName=arrayNumber items.xmlName= items.xmlNamespace= - // items.example= items.type=BigDecimal - @XmlElement(name = "arrayNumber") + + + @XmlElement(name="null") + private List arrayNumber = null; - + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; return this; } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { this.arrayNumber = new ArrayList(); } + this.arrayNumber.add(arrayNumberItem); return this; } - - /** - * Get arrayNumber - * @return arrayNumber + + /** + * Get arrayNumber + * @return arrayNumber **/ @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } - public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -83,8 +84,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -106,5 +106,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayTest.java index 1d87c79cf23..25a42b09867 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ArrayTest.java @@ -33,106 +33,109 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "ArrayTest") public class ArrayTest { + @JsonProperty("array_of_string") - // Is a container wrapped=false - // items.name=arrayOfString items.baseName=arrayOfString items.xmlName= items.xmlNamespace= - // items.example= items.type=String - @XmlElement(name = "arrayOfString") + + + @XmlElement(name="null") + private List arrayOfString = null; - + @JsonProperty("array_array_of_integer") - // Is a container wrapped=false - // items.name=arrayArrayOfInteger items.baseName=arrayArrayOfInteger items.xmlName= items.xmlNamespace= - // items.example= items.type=List<Long> - @XmlElement(name = "arrayArrayOfInteger") + + + @XmlElement(name="arrayArrayOfInteger") + private List> arrayArrayOfInteger = null; - + @JsonProperty("array_array_of_model") - // Is a container wrapped=false - // items.name=arrayArrayOfModel items.baseName=arrayArrayOfModel items.xmlName= items.xmlNamespace= - // items.example= items.type=List<ReadOnlyFirst> - @XmlElement(name = "arrayArrayOfModel") + + + @XmlElement(name="arrayArrayOfModel") + private List> arrayArrayOfModel = null; - + public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; return this; } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { this.arrayOfString = new ArrayList(); } + this.arrayOfString.add(arrayOfStringItem); return this; } - - /** - * Get arrayOfString - * @return arrayOfString + + /** + * Get arrayOfString + * @return arrayOfString **/ @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } - public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } - + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { this.arrayArrayOfInteger = new ArrayList>(); } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger **/ @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } - + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { this.arrayArrayOfModel = new ArrayList>(); } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel **/ @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } - public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -151,8 +154,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -176,5 +178,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Capitalization.java index e615819e615..7f3c8d63165 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Capitalization.java @@ -30,145 +30,145 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Capitalization") public class Capitalization { + @JsonProperty("smallCamel") @JacksonXmlProperty(localName = "smallCamel") - @XmlElement(name = "smallCamel") + @XmlElement(name="smallCamel") private String smallCamel = null; - + @JsonProperty("CapitalCamel") @JacksonXmlProperty(localName = "CapitalCamel") - @XmlElement(name = "CapitalCamel") + @XmlElement(name="CapitalCamel") private String capitalCamel = null; - + @JsonProperty("small_Snake") @JacksonXmlProperty(localName = "small_Snake") - @XmlElement(name = "small_Snake") + @XmlElement(name="small_Snake") private String smallSnake = null; - + @JsonProperty("Capital_Snake") @JacksonXmlProperty(localName = "Capital_Snake") - @XmlElement(name = "Capital_Snake") + @XmlElement(name="Capital_Snake") private String capitalSnake = null; - + @JsonProperty("SCA_ETH_Flow_Points") @JacksonXmlProperty(localName = "SCA_ETH_Flow_Points") - @XmlElement(name = "SCA_ETH_Flow_Points") + @XmlElement(name="SCA_ETH_Flow_Points") private String scAETHFlowPoints = null; - + @JsonProperty("ATT_NAME") @JacksonXmlProperty(localName = "ATT_NAME") - @XmlElement(name = "ATT_NAME") + @XmlElement(name="ATT_NAME") private String ATT_NAME = null; - + public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; return this; } - /** - * Get smallCamel - * @return smallCamel + + /** + * Get smallCamel + * @return smallCamel **/ @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } - public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } - + public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; return this; } - /** - * Get capitalCamel - * @return capitalCamel + + /** + * Get capitalCamel + * @return capitalCamel **/ @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } - public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } - + public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; return this; } - /** - * Get smallSnake - * @return smallSnake + + /** + * Get smallSnake + * @return smallSnake **/ @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } - public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } - + public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; return this; } - /** - * Get capitalSnake - * @return capitalSnake + + /** + * Get capitalSnake + * @return capitalSnake **/ @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } - public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } - + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; return this; } - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints **/ @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } - public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } - + public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; return this; } - /** - * Name of the pet - * @return ATT_NAME + + /** + * Name of the pet + * @return ATT_NAME **/ @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } - public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -190,8 +190,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -218,5 +217,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Cat.java index 2c3754590a1..715a8c04c15 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Cat.java @@ -31,30 +31,76 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Cat") public class Cat extends Animal { + + @JsonProperty("className") + @JacksonXmlProperty(localName = "className") + @XmlElement(name="className") + private String className = null; + + @JsonProperty("color") + @JacksonXmlProperty(localName = "color") + @XmlElement(name="color") + private String color = "red"; + @JsonProperty("declawed") @JacksonXmlProperty(localName = "declawed") - @XmlElement(name = "declawed") + @XmlElement(name="declawed") private Boolean declawed = null; + + public Cat className(String className) { + this.className = className; + return this; + } + + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Cat color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; } - /** - * Get declawed - * @return declawed + + /** + * Get declawed + * @return declawed **/ @ApiModelProperty(value = "") public Boolean isDeclawed() { return declawed; } - public void setDeclawed(Boolean declawed) { this.declawed = declawed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,21 +110,24 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && + return Objects.equals(this.className, cat.className) && + Objects.equals(this.color, cat.color) && + Objects.equals(this.declawed, cat.declawed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(declawed, super.hashCode()); + return Objects.hash(className, color, declawed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); sb.append("}"); return sb.toString(); @@ -95,5 +144,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Category.java index 9b1a6831a5e..31956206e7e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Category.java @@ -30,53 +30,53 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Category") public class Category { + @JsonProperty("id") @JacksonXmlProperty(localName = "id") - @XmlElement(name = "id") + @XmlElement(name="id") private Long id = null; - + @JsonProperty("name") @JacksonXmlProperty(localName = "name") - @XmlElement(name = "name") + @XmlElement(name="name") private String name = null; - + public Category id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Category name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -94,8 +94,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -118,5 +117,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ClassModel.java index ff47df4679a..11c575f1bee 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ClassModel.java @@ -24,37 +24,36 @@ /** * Model for testing model with \"_class\" property - */ -@ApiModel(description = "Model for testing model with \"_class\" property") + */@ApiModel(description = "Model for testing model with \"_class\" property") @XmlRootElement(name = "ClassModel") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "ClassModel") public class ClassModel { + @JsonProperty("_class") @JacksonXmlProperty(localName = "_class") - @XmlElement(name = "_class") + @XmlElement(name="_class") private String propertyClass = null; - + public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -71,8 +70,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -94,5 +92,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Client.java index 6abf4ded943..fc444d22324 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Client.java @@ -30,30 +30,30 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Client") public class Client { + @JsonProperty("client") @JacksonXmlProperty(localName = "client") - @XmlElement(name = "client") + @XmlElement(name="client") private String client = null; - + public Client client(String client) { this.client = client; return this; } - /** - * Get client - * @return client + + /** + * Get client + * @return client **/ @ApiModelProperty(value = "") public String getClient() { return client; } - public void setClient(String client) { this.client = client; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,8 +70,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(client); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -93,5 +92,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Dog.java index 3a1c69148bc..c196147fc09 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Dog.java @@ -31,30 +31,76 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Dog") public class Dog extends Animal { + + @JsonProperty("className") + @JacksonXmlProperty(localName = "className") + @XmlElement(name="className") + private String className = null; + + @JsonProperty("color") + @JacksonXmlProperty(localName = "color") + @XmlElement(name="color") + private String color = "red"; + @JsonProperty("breed") @JacksonXmlProperty(localName = "breed") - @XmlElement(name = "breed") + @XmlElement(name="breed") private String breed = null; + + public Dog className(String className) { + this.className = className; + return this; + } + + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Dog color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Dog breed(String breed) { this.breed = breed; return this; } - /** - * Get breed - * @return breed + + /** + * Get breed + * @return breed **/ @ApiModelProperty(value = "") public String getBreed() { return breed; } - public void setBreed(String breed) { this.breed = breed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,21 +110,24 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && + return Objects.equals(this.className, dog.className) && + Objects.equals(this.color, dog.color) && + Objects.equals(this.breed, dog.breed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(breed, super.hashCode()); + return Objects.hash(className, color, breed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); sb.append("}"); return sb.toString(); @@ -95,5 +144,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumArrays.java index 826a8c7dc57..e011c521410 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumArrays.java @@ -32,12 +32,13 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "EnumArrays") public class EnumArrays { - /** + + /** * Gets or Sets justSymbol */ public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), + GREATER_THAN_OR_EQUAL_TO(">="), DOLLAR("$"); private String value; @@ -45,8 +46,9 @@ public enum JustSymbolEnum { JustSymbolEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -55,8 +57,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static JustSymbolEnum fromValue(String text) { for (JustSymbolEnum b : JustSymbolEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -65,19 +68,22 @@ public static JustSymbolEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("just_symbol") @JacksonXmlProperty(localName = "just_symbol") - @XmlElement(name = "just_symbol") + @XmlElement(name="just_symbol") private JustSymbolEnum justSymbol = null; - - /** + + + /** * Gets or Sets arrayEnum */ public enum ArrayEnumEnum { - FISH("fish"), + FISH("fish"), CRAB("crab"); private String value; @@ -85,8 +91,9 @@ public enum ArrayEnumEnum { ArrayEnumEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -95,8 +102,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static ArrayEnumEnum fromValue(String text) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -105,60 +113,61 @@ public static ArrayEnumEnum fromValue(String text) { } return null; } + } - + @JsonProperty("array_enum") - // Is a container wrapped=false - // items.name=arrayEnum items.baseName=arrayEnum items.xmlName= items.xmlNamespace= - // items.example= items.type=String - @XmlElement(name = "arrayEnum") + + + @XmlElement(name="null") + private List arrayEnum = null; - + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; return this; } - /** - * Get justSymbol - * @return justSymbol + + /** + * Get justSymbol + * @return justSymbol **/ @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } - public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } - + public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; return this; } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { this.arrayEnum = new ArrayList(); } + this.arrayEnum.add(arrayEnumItem); return this; } - - /** - * Get arrayEnum - * @return arrayEnum + + /** + * Get arrayEnum + * @return arrayEnum **/ @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } - public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -176,8 +185,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -200,5 +208,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumClass.java index a9ae3e13dbd..9414211ef6c 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumClass.java @@ -13,16 +13,17 @@ package io.swagger.client.model; -import java.util.Objects; -import com.fasterxml.jackson.dataformat.xml.annotation.*; -import javax.xml.bind.annotation.*; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + + /** * Gets or Sets EnumClass */ + public enum EnumClass { _ABC("_abc"), @@ -37,7 +38,9 @@ public enum EnumClass { this.value = value; } + @JsonValue + public String getValue() { return value; } @@ -47,7 +50,9 @@ public String toString() { return String.valueOf(value); } + @JsonCreator + public static EnumClass fromValue(String text) { for (EnumClass b : EnumClass.values()) { if (String.valueOf(b.value).equals(text)) { @@ -56,5 +61,8 @@ public static EnumClass fromValue(String text) { } return null; } + } + + 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 5eed460c5f7..47469c11a9e 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 @@ -31,14 +31,14 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "EnumTest") public class EnumTest { - /** + + /** * Gets or Sets enumString */ public enum EnumStringEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"), - EMPTY(""); private String value; @@ -46,8 +46,9 @@ public enum EnumStringEnum { EnumStringEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -56,8 +57,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumStringEnum fromValue(String text) { for (EnumStringEnum b : EnumStringEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -66,19 +68,21 @@ public static EnumStringEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_string") @JacksonXmlProperty(localName = "enum_string") - @XmlElement(name = "enum_string") + @XmlElement(name="enum_string") private EnumStringEnum enumString = null; - - /** + + /** * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(1), NUMBER_MINUS_1(-1); private Integer value; @@ -86,8 +90,9 @@ public enum EnumIntegerEnum { EnumIntegerEnum(Integer value) { this.value = value; } - + @JsonValue + public Integer getValue() { return value; } @@ -96,8 +101,9 @@ public Integer getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumIntegerEnum fromValue(String text) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -106,19 +112,21 @@ public static EnumIntegerEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_integer") @JacksonXmlProperty(localName = "enum_integer") - @XmlElement(name = "enum_integer") + @XmlElement(name="enum_integer") private EnumIntegerEnum enumInteger = null; - - /** + + /** * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(1.1), NUMBER_MINUS_1_DOT_2(-1.2); private Double value; @@ -126,8 +134,9 @@ public enum EnumNumberEnum { EnumNumberEnum(Double value) { this.value = value; } - + @JsonValue + public Double getValue() { return value; } @@ -136,8 +145,9 @@ public Double getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumNumberEnum fromValue(String text) { for (EnumNumberEnum b : EnumNumberEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -146,91 +156,92 @@ public static EnumNumberEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_number") @JacksonXmlProperty(localName = "enum_number") - @XmlElement(name = "enum_number") + @XmlElement(name="enum_number") private EnumNumberEnum enumNumber = null; - + @JsonProperty("outerEnum") @JacksonXmlProperty(localName = "outerEnum") - @XmlElement(name = "outerEnum") + @XmlElement(name="outerEnum") private OuterEnum outerEnum = null; - + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; } - /** - * Get enumString - * @return enumString + + /** + * Get enumString + * @return enumString **/ @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } - public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } - + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; } - /** - * Get enumInteger - * @return enumInteger + + /** + * Get enumInteger + * @return enumInteger **/ @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } - public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } - + public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; return this; } - /** - * Get enumNumber - * @return enumNumber + + /** + * Get enumNumber + * @return enumNumber **/ @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } - public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - + public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; return this; } - /** - * Get outerEnum - * @return outerEnum + + /** + * Get outerEnum + * @return outerEnum **/ @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -250,8 +261,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -276,5 +286,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\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 d0860fabab4..2799e8144a1 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 @@ -34,316 +34,310 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "FormatTest") public class FormatTest { + @JsonProperty("integer") @JacksonXmlProperty(localName = "integer") - @XmlElement(name = "integer") + @XmlElement(name="integer") private Integer integer = null; - + @JsonProperty("int32") @JacksonXmlProperty(localName = "int32") - @XmlElement(name = "int32") + @XmlElement(name="int32") private Integer int32 = null; - + @JsonProperty("int64") @JacksonXmlProperty(localName = "int64") - @XmlElement(name = "int64") + @XmlElement(name="int64") private Long int64 = null; - + @JsonProperty("number") @JacksonXmlProperty(localName = "number") - @XmlElement(name = "number") + @XmlElement(name="number") private BigDecimal number = null; - + @JsonProperty("float") @JacksonXmlProperty(localName = "float") - @XmlElement(name = "float") + @XmlElement(name="float") private Float _float = null; - + @JsonProperty("double") @JacksonXmlProperty(localName = "double") - @XmlElement(name = "double") + @XmlElement(name="double") private Double _double = null; - + @JsonProperty("string") @JacksonXmlProperty(localName = "string") - @XmlElement(name = "string") + @XmlElement(name="string") private String string = null; - + @JsonProperty("byte") @JacksonXmlProperty(localName = "byte") - @XmlElement(name = "byte") - private byte[] _byte = null; - + @XmlElement(name="byte") + private String _byte = null; + @JsonProperty("binary") @JacksonXmlProperty(localName = "binary") - @XmlElement(name = "binary") - private byte[] binary = null; - + @XmlElement(name="binary") + private String binary = null; + @JsonProperty("date") @JacksonXmlProperty(localName = "date") - @XmlElement(name = "date") + @XmlElement(name="date") private LocalDate date = null; - + @JsonProperty("dateTime") @JacksonXmlProperty(localName = "dateTime") - @XmlElement(name = "dateTime") + @XmlElement(name="dateTime") private OffsetDateTime dateTime = null; - + @JsonProperty("uuid") @JacksonXmlProperty(localName = "uuid") - @XmlElement(name = "uuid") + @XmlElement(name="uuid") private UUID uuid = null; - + @JsonProperty("password") @JacksonXmlProperty(localName = "password") - @XmlElement(name = "password") + @XmlElement(name="password") private String password = null; - + public FormatTest integer(Integer integer) { this.integer = integer; return this; } - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer **/ @ApiModelProperty(value = "") public Integer getInteger() { return integer; } - public void setInteger(Integer integer) { this.integer = integer; } - + public FormatTest int32(Integer int32) { this.int32 = int32; return this; } - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 **/ @ApiModelProperty(value = "") public Integer getInt32() { return int32; } - public void setInt32(Integer int32) { this.int32 = int32; } - + public FormatTest int64(Long int64) { this.int64 = int64; return this; } - /** - * Get int64 - * @return int64 + + /** + * Get int64 + * @return int64 **/ @ApiModelProperty(value = "") public Long getInt64() { return int64; } - public void setInt64(Long int64) { this.int64 = int64; } - + public FormatTest number(BigDecimal number) { this.number = number; return this; } - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number + + /** + * Get number + * @return number **/ @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } - public void setNumber(BigDecimal number) { this.number = number; } - + public FormatTest _float(Float _float) { this._float = _float; return this; } - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float + + /** + * Get _float + * @return _float **/ @ApiModelProperty(value = "") public Float getFloat() { return _float; } - public void setFloat(Float _float) { this._float = _float; } - + public FormatTest _double(Double _double) { this._double = _double; return this; } - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double + + /** + * Get _double + * @return _double **/ @ApiModelProperty(value = "") public Double getDouble() { return _double; } - public void setDouble(Double _double) { this._double = _double; } - + public FormatTest string(String string) { this.string = string; return this; } - /** - * Get string - * @return string + + /** + * Get string + * @return string **/ @ApiModelProperty(value = "") public String getString() { return string; } - public void setString(String string) { this.string = string; } - - public FormatTest _byte(byte[] _byte) { + + public FormatTest _byte(String _byte) { this._byte = _byte; return this; } - /** - * Get _byte - * @return _byte + + /** + * Get _byte + * @return _byte **/ @ApiModelProperty(required = true, value = "") - public byte[] getByte() { + public String getByte() { return _byte; } - - public void setByte(byte[] _byte) { + public void setByte(String _byte) { this._byte = _byte; } - - public FormatTest binary(byte[] binary) { + + public FormatTest binary(String binary) { this.binary = binary; return this; } - /** - * Get binary - * @return binary + + /** + * Get binary + * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public String getBinary() { return binary; } - - public void setBinary(byte[] binary) { + public void setBinary(String binary) { this.binary = binary; } - + public FormatTest date(LocalDate date) { this.date = date; return this; } - /** - * Get date - * @return date + + /** + * Get date + * @return date **/ @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } - public void setDate(LocalDate date) { this.date = date; } - + public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public FormatTest password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -372,8 +366,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -407,5 +400,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 9d54eca095a..6cd726a93da 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -30,35 +30,37 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "HasOnlyReadOnly") public class HasOnlyReadOnly { + @JsonProperty("bar") @JacksonXmlProperty(localName = "bar") - @XmlElement(name = "bar") + @XmlElement(name="bar") private String bar = null; - + @JsonProperty("foo") @JacksonXmlProperty(localName = "foo") - @XmlElement(name = "foo") + @XmlElement(name="foo") private String foo = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - - /** - * Get foo - * @return foo + + + /** + * Get foo + * @return foo **/ @ApiModelProperty(value = "") public String getFoo() { return foo; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -76,8 +78,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, foo); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,5 +101,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/MapTest.java index 72a58a1ee68..e02f54fe595 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/MapTest.java @@ -33,19 +33,21 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "MapTest") public class MapTest { + @JsonProperty("map_map_of_string") - // Is a container wrapped=false - // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= - // items.example= items.type=Map<String, String> - @XmlElement(name = "inner") + + + @XmlElement(name="inner") + private Map> mapMapOfString = null; - - /** + + + /** * Gets or Sets inner */ public enum InnerEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"); private String value; @@ -53,8 +55,9 @@ public enum InnerEnum { InnerEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -63,8 +66,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static InnerEnum fromValue(String text) { for (InnerEnum b : InnerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -73,68 +77,68 @@ public static InnerEnum fromValue(String text) { } return null; } + } - + @JsonProperty("map_of_enum_string") - // Is a container wrapped=false - // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= - // items.example= items.type=String - @XmlElement(name = "inner") + + + @XmlElement(name="null") + private Map mapOfEnumString = null; - + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { this.mapMapOfString = new HashMap>(); } + this.mapMapOfString.put(key, mapMapOfStringItem); return this; } - - /** - * Get mapMapOfString - * @return mapMapOfString + /** + * Get mapMapOfString + * @return mapMapOfString **/ @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } - public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } - + public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; return this; } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { this.mapOfEnumString = new HashMap(); } + this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } - - /** - * Get mapOfEnumString - * @return mapOfEnumString + /** + * Get mapOfEnumString + * @return mapOfEnumString **/ @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } - public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -152,8 +156,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -176,5 +179,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 2819b08e715..354d620ba07 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -36,86 +36,86 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "MixedPropertiesAndAdditionalPropertiesClass") public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") @JacksonXmlProperty(localName = "uuid") - @XmlElement(name = "uuid") + @XmlElement(name="uuid") private UUID uuid = null; - + @JsonProperty("dateTime") @JacksonXmlProperty(localName = "dateTime") - @XmlElement(name = "dateTime") + @XmlElement(name="dateTime") private OffsetDateTime dateTime = null; - + @JsonProperty("map") - // Is a container wrapped=false - // items.name=inner items.baseName=inner items.xmlName= items.xmlNamespace= - // items.example= items.type=Animal - @XmlElement(name = "inner") + + + @XmlElement(name="null") + private Map map = null; - + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; return this; } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { this.map = new HashMap(); } + this.map.put(key, mapItem); return this; } - - /** - * Get map - * @return map + /** + * Get map + * @return map **/ @ApiModelProperty(value = "") public Map getMap() { return map; } - public void setMap(Map map) { this.map = map; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -134,8 +134,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(uuid, dateTime, map); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -159,5 +158,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 fe0f079c094..bb8602aa324 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 @@ -24,60 +24,59 @@ /** * Model for testing model name starting with number - */ -@ApiModel(description = "Model for testing model name starting with number") + */@ApiModel(description = "Model for testing model name starting with number") @XmlRootElement(name = "Name") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Name") public class Model200Response { + @JsonProperty("name") @JacksonXmlProperty(localName = "name") - @XmlElement(name = "name") + @XmlElement(name="name") private Integer name = null; - + @JsonProperty("class") @JacksonXmlProperty(localName = "class") - @XmlElement(name = "class") + @XmlElement(name="class") private String propertyClass = null; - + public Model200Response name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - + public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -95,8 +94,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -119,5 +117,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelApiResponse.java index 4fd7b7ec649..05239702dc1 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -30,76 +30,76 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "ModelApiResponse") public class ModelApiResponse { + @JsonProperty("code") @JacksonXmlProperty(localName = "code") - @XmlElement(name = "code") + @XmlElement(name="code") private Integer code = null; - + @JsonProperty("type") @JacksonXmlProperty(localName = "type") - @XmlElement(name = "type") + @XmlElement(name="type") private String type = null; - + @JsonProperty("message") @JacksonXmlProperty(localName = "message") - @XmlElement(name = "message") + @XmlElement(name="message") private String message = null; - + public ModelApiResponse code(Integer code) { this.code = code; return this; } - /** - * Get code - * @return code + + /** + * Get code + * @return code **/ @ApiModelProperty(value = "") public Integer getCode() { return code; } - public void setCode(Integer code) { this.code = code; } - + public ModelApiResponse type(String type) { this.type = type; return this; } - /** - * Get type - * @return type + + /** + * Get type + * @return type **/ @ApiModelProperty(value = "") public String getType() { return type; } - public void setType(String type) { this.type = type; } - + public ModelApiResponse message(String message) { this.message = message; return this; } - /** - * Get message - * @return message + + /** + * Get message + * @return message **/ @ApiModelProperty(value = "") public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -118,8 +118,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(code, type, message); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -143,5 +142,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelReturn.java index 01db1577d56..a38617ee4a5 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelReturn.java @@ -24,37 +24,36 @@ /** * Model for testing reserved words - */ -@ApiModel(description = "Model for testing reserved words") + */@ApiModel(description = "Model for testing reserved words") @XmlRootElement(name = "Return") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Return") public class ModelReturn { + @JsonProperty("return") @JacksonXmlProperty(localName = "return") - @XmlElement(name = "return") + @XmlElement(name="return") private Integer _return = null; - + public ModelReturn _return(Integer _return) { this._return = _return; return this; } - /** - * Get _return - * @return _return + + /** + * Get _return + * @return _return **/ @ApiModelProperty(value = "") public Integer getReturn() { return _return; } - public void setReturn(Integer _return) { this._return = _return; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -71,8 +70,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(_return); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -94,5 +92,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 546adf743d4..167c828a78e 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 @@ -24,88 +24,89 @@ /** * Model for testing model name same as property name - */ -@ApiModel(description = "Model for testing model name same as property name") + */@ApiModel(description = "Model for testing model name same as property name") @XmlRootElement(name = "Name") @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Name") public class Name { + @JsonProperty("name") @JacksonXmlProperty(localName = "name") - @XmlElement(name = "name") + @XmlElement(name="name") private Integer name = null; - + @JsonProperty("snake_case") @JacksonXmlProperty(localName = "snake_case") - @XmlElement(name = "snake_case") + @XmlElement(name="snake_case") private Integer snakeCase = null; - + @JsonProperty("property") @JacksonXmlProperty(localName = "property") - @XmlElement(name = "property") + @XmlElement(name="property") private String property = null; - + @JsonProperty("123Number") @JacksonXmlProperty(localName = "123Number") - @XmlElement(name = "123Number") + @XmlElement(name="123Number") private Integer _123Number = null; - + public Name name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - - /** - * Get snakeCase - * @return snakeCase + + + /** + * Get snakeCase + * @return snakeCase **/ @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } - + public Name property(String property) { this.property = property; return this; } - /** - * Get property - * @return property + + /** + * Get property + * @return property **/ @ApiModelProperty(value = "") public String getProperty() { return property; } - public void setProperty(String property) { this.property = property; } - - /** - * Get _123Number - * @return _123Number + + + /** + * Get _123Number + * @return _123Number **/ @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -125,8 +126,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, snakeCase, property, _123Number); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -151,5 +151,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/NumberOnly.java index 657647cd2e3..ee3450b853d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/NumberOnly.java @@ -31,30 +31,30 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "NumberOnly") public class NumberOnly { + @JsonProperty("JustNumber") @JacksonXmlProperty(localName = "JustNumber") - @XmlElement(name = "JustNumber") + @XmlElement(name="JustNumber") private BigDecimal justNumber = null; - + public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; return this; } - /** - * Get justNumber - * @return justNumber + + /** + * Get justNumber + * @return justNumber **/ @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } - public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -71,8 +71,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -94,5 +93,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Order.java index de1b90ef6a5..046ceccf545 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Order.java @@ -31,34 +31,34 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Order") public class Order { + @JsonProperty("id") @JacksonXmlProperty(localName = "id") - @XmlElement(name = "id") + @XmlElement(name="id") private Long id = null; - + @JsonProperty("petId") @JacksonXmlProperty(localName = "petId") - @XmlElement(name = "petId") + @XmlElement(name="petId") private Long petId = null; - + @JsonProperty("quantity") @JacksonXmlProperty(localName = "quantity") - @XmlElement(name = "quantity") + @XmlElement(name="quantity") private Integer quantity = null; - + @JsonProperty("shipDate") @JacksonXmlProperty(localName = "shipDate") - @XmlElement(name = "shipDate") + @XmlElement(name="shipDate") private OffsetDateTime shipDate = null; - - /** + + /** * Order Status */ public enum StatusEnum { - PLACED("placed"), + PLACED("placed"), APPROVED("approved"), - DELIVERED("delivered"); private String value; @@ -66,8 +66,9 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -76,8 +77,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -86,127 +88,128 @@ public static StatusEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("status") @JacksonXmlProperty(localName = "status") - @XmlElement(name = "status") + @XmlElement(name="status") private StatusEnum status = null; - + @JsonProperty("complete") @JacksonXmlProperty(localName = "complete") - @XmlElement(name = "complete") + @XmlElement(name="complete") private Boolean complete = false; - + public Order id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Order petId(Long petId) { this.petId = petId; return this; } - /** - * Get petId - * @return petId + + /** + * Get petId + * @return petId **/ @ApiModelProperty(value = "") public Long getPetId() { return petId; } - public void setPetId(Long petId) { this.petId = petId; } - + public Order quantity(Integer quantity) { this.quantity = quantity; return this; } - /** - * Get quantity - * @return quantity + + /** + * Get quantity + * @return quantity **/ @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } - public void setQuantity(Integer quantity) { this.quantity = quantity; } - + public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; return this; } - /** - * Get shipDate - * @return shipDate + + /** + * Get shipDate + * @return shipDate **/ @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } - public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } - + public Order status(StatusEnum status) { this.status = status; return this; } - /** - * Order Status - * @return status + + /** + * Order Status + * @return status **/ @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - + public Order complete(Boolean complete) { this.complete = complete; return this; } - /** - * Get complete - * @return complete + + /** + * Get complete + * @return complete **/ @ApiModelProperty(value = "") public Boolean isComplete() { return complete; } - public void setComplete(Boolean complete) { this.complete = complete; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -228,8 +231,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -256,5 +258,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterComposite.java index 1690010ca8c..72d36c66afb 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterComposite.java @@ -31,76 +31,76 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "OuterComposite") public class OuterComposite { + @JsonProperty("my_number") @JacksonXmlProperty(localName = "my_number") - @XmlElement(name = "my_number") + @XmlElement(name="my_number") private BigDecimal myNumber = null; - + @JsonProperty("my_string") @JacksonXmlProperty(localName = "my_string") - @XmlElement(name = "my_string") + @XmlElement(name="my_string") private String myString = null; - + @JsonProperty("my_boolean") @JacksonXmlProperty(localName = "my_boolean") - @XmlElement(name = "my_boolean") + @XmlElement(name="my_boolean") private Boolean myBoolean = null; - + public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; return this; } - /** - * Get myNumber - * @return myNumber + + /** + * Get myNumber + * @return myNumber **/ @ApiModelProperty(value = "") public BigDecimal getMyNumber() { return myNumber; } - public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } - + public OuterComposite myString(String myString) { this.myString = myString; return this; } - /** - * Get myString - * @return myString + + /** + * Get myString + * @return myString **/ @ApiModelProperty(value = "") public String getMyString() { return myString; } - public void setMyString(String myString) { this.myString = myString; } - + public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; return this; } - /** - * Get myBoolean - * @return myBoolean + + /** + * Get myBoolean + * @return myBoolean **/ @ApiModelProperty(value = "") public Boolean getMyBoolean() { return myBoolean; } - public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -119,8 +119,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(myNumber, myString, myBoolean); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -144,5 +143,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterEnum.java index ec2ccbf9887..3390d473c7b 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterEnum.java @@ -13,16 +13,17 @@ package io.swagger.client.model; -import java.util.Objects; -import com.fasterxml.jackson.dataformat.xml.annotation.*; -import javax.xml.bind.annotation.*; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + + /** * Gets or Sets OuterEnum */ + public enum OuterEnum { PLACED("placed"), @@ -37,7 +38,9 @@ public enum OuterEnum { this.value = value; } + @JsonValue + public String getValue() { return value; } @@ -47,7 +50,9 @@ public String toString() { return String.valueOf(value); } + @JsonCreator + public static OuterEnum fromValue(String text) { for (OuterEnum b : OuterEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -56,5 +61,8 @@ public static OuterEnum fromValue(String text) { } return null; } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Pet.java index 0e43949b872..913d1a18e1f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Pet.java @@ -34,49 +34,47 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Pet") public class Pet { + @JsonProperty("id") @JacksonXmlProperty(localName = "id") - @XmlElement(name = "id") + @XmlElement(name="id") private Long id = null; - + @JsonProperty("category") @JacksonXmlProperty(localName = "category") - @XmlElement(name = "category") + @XmlElement(name="category") private Category category = null; - + @JsonProperty("name") @JacksonXmlProperty(localName = "name") - @XmlElement(name = "name") + @XmlElement(name="name") private String name = null; - + @JsonProperty("photoUrls") + // items.xmlName= - @JacksonXmlElementWrapper(useWrapping = true, localName = "photoUrls") - // Is a container wrapped=true - // items.name=photoUrls items.baseName=photoUrls items.xmlName= items.xmlNamespace= - // items.example= items.type=String - @XmlElement(name = "photoUrls") - @XmlElementWrapper(name = "photoUrl") + @JacksonXmlElementWrapper(useWrapping = true, localName = "null") + + @XmlElement(name="null") + @XmlElementWrapper(name="photoUrl") private List photoUrls = new ArrayList(); - + @JsonProperty("tags") + // items.xmlName= - @JacksonXmlElementWrapper(useWrapping = true, localName = "tags") - // Is a container wrapped=true - // items.name=tags items.baseName=tags items.xmlName= items.xmlNamespace= - // items.example= items.type=Tag - @XmlElement(name = "tags") - @XmlElementWrapper(name = "tag") + @JacksonXmlElementWrapper(useWrapping = true, localName = "null") + + @XmlElement(name="null") + @XmlElementWrapper(name="tag") private List tags = null; - - /** + + /** * pet status in the store */ public enum StatusEnum { - AVAILABLE("available"), + AVAILABLE("available"), PENDING("pending"), - SOLD("sold"); private String value; @@ -84,8 +82,9 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -94,8 +93,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -104,135 +104,137 @@ public static StatusEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("status") @JacksonXmlProperty(localName = "status") - @XmlElement(name = "status") + @XmlElement(name="status") private StatusEnum status = null; - + public Pet id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Pet category(Category category) { this.category = category; return this; } - /** - * Get category - * @return category + + /** + * Get category + * @return category **/ @ApiModelProperty(value = "") public Category getCategory() { return category; } - public void setCategory(Category category) { this.category = category; } - + public Pet name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - + public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); return this; } - - /** - * Get photoUrls - * @return photoUrls + + /** + * Get photoUrls + * @return photoUrls **/ @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } - + public Pet tags(List tags) { this.tags = tags; return this; } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { this.tags = new ArrayList(); } + this.tags.add(tagsItem); return this; } - - /** - * Get tags - * @return tags + + /** + * Get tags + * @return tags **/ @ApiModelProperty(value = "") public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } - + public Pet status(StatusEnum status) { this.status = status; return this; } - /** - * pet status in the store - * @return status + + /** + * pet status in the store + * @return status **/ @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -254,8 +256,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -282,5 +283,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 0b09758c5ea..c07ba847746 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -30,44 +30,45 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "ReadOnlyFirst") public class ReadOnlyFirst { + @JsonProperty("bar") @JacksonXmlProperty(localName = "bar") - @XmlElement(name = "bar") + @XmlElement(name="bar") private String bar = null; - + @JsonProperty("baz") @JacksonXmlProperty(localName = "baz") - @XmlElement(name = "baz") + @XmlElement(name="baz") private String baz = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; } - /** - * Get baz - * @return baz + + /** + * Get baz + * @return baz **/ @ApiModelProperty(value = "") public String getBaz() { return baz; } - public void setBaz(String baz) { this.baz = baz; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -85,8 +86,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, baz); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -109,5 +109,8 @@ private String toIndentedString(java.lang.Object o) { 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 b599c58ffdb..e7f9582d9e1 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 @@ -30,30 +30,30 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "$special[model.name]") public class SpecialModelName { + @JsonProperty("$special[property.name]") @JacksonXmlProperty(localName = "$special[property.name]") - @XmlElement(name = "$special[property.name]") - private Long specialPropertyName = null; - - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + @XmlElement(name="$special[property.name]") + private Long $specialPropertyName = null; + + 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; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -62,22 +62,21 @@ public boolean equals(java.lang.Object o) { 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); } - - + @Override public String toString() { 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(); } @@ -93,5 +92,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Tag.java index 624044bc22a..087265e26a6 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Tag.java @@ -30,53 +30,53 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "Tag") public class Tag { + @JsonProperty("id") @JacksonXmlProperty(localName = "id") - @XmlElement(name = "id") + @XmlElement(name="id") private Long id = null; - + @JsonProperty("name") @JacksonXmlProperty(localName = "name") - @XmlElement(name = "name") + @XmlElement(name="name") private String name = null; - + public Tag id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Tag name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -94,8 +94,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -118,5 +117,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/User.java index af41ec70447..f4deac3a766 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/User.java @@ -30,191 +30,191 @@ @XmlAccessorType(XmlAccessType.FIELD) @JacksonXmlRootElement(localName = "User") public class User { + @JsonProperty("id") @JacksonXmlProperty(localName = "id") - @XmlElement(name = "id") + @XmlElement(name="id") private Long id = null; - + @JsonProperty("username") @JacksonXmlProperty(localName = "username") - @XmlElement(name = "username") + @XmlElement(name="username") private String username = null; - + @JsonProperty("firstName") @JacksonXmlProperty(localName = "firstName") - @XmlElement(name = "firstName") + @XmlElement(name="firstName") private String firstName = null; - + @JsonProperty("lastName") @JacksonXmlProperty(localName = "lastName") - @XmlElement(name = "lastName") + @XmlElement(name="lastName") private String lastName = null; - + @JsonProperty("email") @JacksonXmlProperty(localName = "email") - @XmlElement(name = "email") + @XmlElement(name="email") private String email = null; - + @JsonProperty("password") @JacksonXmlProperty(localName = "password") - @XmlElement(name = "password") + @XmlElement(name="password") private String password = null; - + @JsonProperty("phone") @JacksonXmlProperty(localName = "phone") - @XmlElement(name = "phone") + @XmlElement(name="phone") private String phone = null; - + @JsonProperty("userStatus") @JacksonXmlProperty(localName = "userStatus") - @XmlElement(name = "userStatus") + @XmlElement(name="userStatus") private Integer userStatus = null; - + public User id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public User username(String username) { this.username = username; return this; } - /** - * Get username - * @return username + + /** + * Get username + * @return username **/ @ApiModelProperty(value = "") public String getUsername() { return username; } - public void setUsername(String username) { this.username = username; } - + public User firstName(String firstName) { this.firstName = firstName; return this; } - /** - * Get firstName - * @return firstName + + /** + * Get firstName + * @return firstName **/ @ApiModelProperty(value = "") public String getFirstName() { return firstName; } - public void setFirstName(String firstName) { this.firstName = firstName; } - + public User lastName(String lastName) { this.lastName = lastName; return this; } - /** - * Get lastName - * @return lastName + + /** + * Get lastName + * @return lastName **/ @ApiModelProperty(value = "") public String getLastName() { return lastName; } - public void setLastName(String lastName) { this.lastName = lastName; } - + public User email(String email) { this.email = email; return this; } - /** - * Get email - * @return email + + /** + * Get email + * @return email **/ @ApiModelProperty(value = "") public String getEmail() { return email; } - public void setEmail(String email) { this.email = email; } - + public User password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - + public User phone(String phone) { this.phone = phone; return this; } - /** - * Get phone - * @return phone + + /** + * Get phone + * @return phone **/ @ApiModelProperty(value = "") public String getPhone() { return phone; } - public void setPhone(String phone) { this.phone = phone; } - + public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; } - /** - * User Status - * @return userStatus + + /** + * User Status + * @return userStatus **/ @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } - public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -238,8 +238,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -268,5 +267,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..6fdbe0d606c 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 @@ -14,14 +14,17 @@ package io.swagger.client.api; import io.swagger.client.model.Client; + 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 AnotherFakeApi */ @@ -41,8 +44,10 @@ 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..ffbadbfc5f5 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,17 +15,18 @@ 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 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 FakeApi */ @@ -45,7 +46,9 @@ public class FakeApiTest { */ @Test public void fakeOuterBooleanSerializeTest() { + Boolean body = null; + Boolean response = api.fakeOuterBooleanSerialize(body); // TODO: test validations @@ -61,8 +64,10 @@ public void fakeOuterBooleanSerializeTest() { */ @Test public void fakeOuterCompositeSerializeTest() { - OuterComposite body = null; - OuterComposite response = api.fakeOuterCompositeSerialize(body); + + OuterComposite outercomposite = null; + + OuterComposite response = api.fakeOuterCompositeSerialize(outercomposite); // TODO: test validations } @@ -77,7 +82,9 @@ public void fakeOuterCompositeSerializeTest() { */ @Test public void fakeOuterNumberSerializeTest() { + BigDecimal body = null; + BigDecimal response = api.fakeOuterNumberSerialize(body); // TODO: test validations @@ -93,7 +100,9 @@ public void fakeOuterNumberSerializeTest() { */ @Test public void fakeOuterStringSerializeTest() { + String body = null; + String response = api.fakeOuterStringSerialize(body); // TODO: test validations @@ -109,8 +118,10 @@ public void fakeOuterStringSerializeTest() { */ @Test public void testClientModelTest() { - Client body = null; - Client response = api.testClientModel(body); + + Client client = null; + + Client response = api.testClientModel(client); // TODO: test validations } @@ -125,21 +136,10 @@ public void testClientModelTest() { */ @Test public void testEndpointParametersTest() { - BigDecimal number = null; - Double _double = null; - String patternWithoutDelimiter = null; - byte[] _byte = null; - Integer integer = null; - Integer int32 = null; - Long int64 = null; - Float _float = null; - String string = null; - byte[] binary = null; - LocalDate date = null; - OffsetDateTime dateTime = null; - String password = null; - String paramCallback = null; - api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + + Object body = null; + + api.testEndpointParameters(body); // TODO: test validations } @@ -154,15 +154,38 @@ public void testEndpointParametersTest() { */ @Test public void testEnumParametersTest() { - List enumFormStringArray = null; - String enumFormString = null; + + Object body = 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); + + api.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); + + // TODO: test validations + } + + /** + * test inline additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineAdditionalPropertiesTest() { + + Map body = null; + + api.testInlineAdditionalProperties(body); // TODO: test validations } @@ -177,9 +200,10 @@ public void testEnumParametersTest() { */ @Test public void testJsonFormDataTest() { - String param = null; - String param2 = null; - api.testJsonFormData(param, param2); + + Object body = null; + + api.testJsonFormData(body); // 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..8c2f3365902 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 @@ -14,14 +14,17 @@ package io.swagger.client.api; import io.swagger.client.model.Client; + 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 FakeClassnameTags123Api */ @@ -41,8 +44,10 @@ public class FakeClassnameTags123ApiTest { */ @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..21ff6da020f 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 @@ -13,17 +13,19 @@ package io.swagger.client.api; -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 */ @@ -43,8 +45,10 @@ public class PetApiTest { */ @Test public void addPetTest() { - Pet body = null; - api.addPet(body); + + Pet pet = null; + + api.addPet(pet); // TODO: test validations } @@ -59,8 +63,11 @@ public void addPetTest() { */ @Test public void deletePetTest() { - Long petId = null; + + Integer petId = null; + String apiKey = null; + api.deletePet(petId, apiKey); // TODO: test validations @@ -76,7 +83,9 @@ public void deletePetTest() { */ @Test public void findPetsByStatusTest() { + List status = null; + List response = api.findPetsByStatus(status); // TODO: test validations @@ -92,7 +101,9 @@ public void findPetsByStatusTest() { */ @Test public void findPetsByTagsTest() { + List tags = null; + List response = api.findPetsByTags(tags); // TODO: test validations @@ -108,7 +119,9 @@ public void findPetsByTagsTest() { */ @Test public void getPetByIdTest() { - Long petId = null; + + Integer petId = null; + Pet response = api.getPetById(petId); // TODO: test validations @@ -124,8 +137,10 @@ public void getPetByIdTest() { */ @Test public void updatePetTest() { - Pet body = null; - api.updatePet(body); + + Pet pet = null; + + api.updatePet(pet); // TODO: test validations } @@ -140,10 +155,12 @@ public void updatePetTest() { */ @Test public void updatePetWithFormTest() { - Long petId = null; - String name = null; - String status = null; - api.updatePetWithForm(petId, name, status); + + Integer petId = null; + + Object body = null; + + api.updatePetWithForm(petId, body); // TODO: test validations } @@ -158,10 +175,12 @@ public void updatePetWithFormTest() { */ @Test public void uploadFileTest() { - Long petId = null; - String additionalMetadata = null; - File file = null; - ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + + Integer petId = null; + + Object body = null; + + ModelApiResponse response = api.uploadFile(petId, body); // 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..4b7a616eba0 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 @@ -14,14 +14,17 @@ package io.swagger.client.api; 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 */ @@ -41,7 +44,9 @@ public class StoreApiTest { */ @Test public void deleteOrderTest() { + String orderId = null; + api.deleteOrder(orderId); // TODO: test validations @@ -57,6 +62,7 @@ public void deleteOrderTest() { */ @Test public void getInventoryTest() { + Map response = api.getInventory(); // TODO: test validations @@ -72,7 +78,9 @@ public void getInventoryTest() { */ @Test public void getOrderByIdTest() { - Long orderId = null; + + Integer orderId = null; + Order response = api.getOrderById(orderId); // TODO: test validations @@ -88,8 +96,10 @@ public void getOrderByIdTest() { */ @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..c3d9b85c156 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 @@ -14,14 +14,17 @@ package io.swagger.client.api; 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 */ @@ -41,8 +44,10 @@ public class UserApiTest { */ @Test public void createUserTest() { - User body = null; - api.createUser(body); + + User user = null; + + api.createUser(user); // TODO: test validations } @@ -57,7 +62,9 @@ public void createUserTest() { */ @Test public void createUsersWithArrayInputTest() { + List body = null; + api.createUsersWithArrayInput(body); // TODO: test validations @@ -73,7 +80,9 @@ public void createUsersWithArrayInputTest() { */ @Test public void createUsersWithListInputTest() { + List body = null; + api.createUsersWithListInput(body); // TODO: test validations @@ -89,7 +98,9 @@ public void createUsersWithListInputTest() { */ @Test public void deleteUserTest() { + String username = null; + api.deleteUser(username); // TODO: test validations @@ -105,7 +116,9 @@ public void deleteUserTest() { */ @Test public void getUserByNameTest() { + String username = null; + User response = api.getUserByName(username); // TODO: test validations @@ -121,8 +134,11 @@ public void getUserByNameTest() { */ @Test public void loginUserTest() { + String username = null; + String password = null; + String response = api.loginUser(username, password); // TODO: test validations @@ -138,6 +154,7 @@ public void loginUserTest() { */ @Test public void logoutUserTest() { + api.logoutUser(); // TODO: test validations @@ -153,9 +170,12 @@ public void logoutUserTest() { */ @Test public void updateUserTest() { + + User user = null; + String username = null; - User body = null; - api.updateUser(username, body); + + api.updateUser(user, username); // TODO: test validations } diff --git a/samples/client/petstore/java/resttemplate/.swagger-codegen/VERSION b/samples/client/petstore/java/resttemplate/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/client/petstore/java/resttemplate/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/resttemplate/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate/README.md b/samples/client/petstore/java/resttemplate/README.md index 4632c0742a4..29f5ac839da 100644 --- a/samples/client/petstore/java/resttemplate/README.md +++ b/samples/client/petstore/java/resttemplate/README.md @@ -61,22 +61,27 @@ 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) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + + + AnotherFakeApi apiInstance = new AnotherFakeApi(); + + Client client = ; // Client | client model - FakeApi apiInstance = new FakeApi(); - Boolean body = true; // Boolean | Input boolean as post body 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,6 +95,7 @@ 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 | @@ -97,6 +103,7 @@ Class | Method | HTTP request | Description *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 @@ -125,14 +132,15 @@ Class | Method | HTTP request | Description - [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) @@ -153,8 +161,6 @@ Class | Method | HTTP request | Description - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) - - [Cat](docs/Cat.md) - - [Dog](docs/Dog.md) ## Documentation for Authorization @@ -166,18 +172,37 @@ 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 - **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 diff --git a/samples/client/petstore/java/resttemplate/build.gradle b/samples/client/petstore/java/resttemplate/build.gradle index 4ad1f2e1229..1157e568659 100644 --- a/samples/client/petstore/java/resttemplate/build.gradle +++ b/samples/client/petstore/java/resttemplate/build.gradle @@ -32,8 +32,11 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 22 } compileOptions { + + sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 + } // Rename the aar correctly @@ -78,8 +81,11 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'java' apply plugin: 'maven' + + sourceCompatibility = JavaVersion.VERSION_1_7 targetCompatibility = JavaVersion.VERSION_1_7 + install { repositories.mavenInstaller { @@ -99,7 +105,9 @@ ext { spring_web_version = "4.3.9.RELEASE" jodatime_version = "2.9.9" junit_version = "4.12" + jackson_threeten_version = "2.6.4" + } dependencies { @@ -109,6 +117,11 @@ 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_threeten_version" + + testCompile "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/resttemplate/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/resttemplate/docs/AdditionalPropertiesClass.md index 0437c4dd8cc..b37862da7cf 100644 --- a/samples/client/petstore/java/resttemplate/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/java/resttemplate/docs/AdditionalPropertiesClass.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate/docs/Animal.md b/samples/client/petstore/java/resttemplate/docs/Animal.md index b3f325c3524..346caaf63f4 100644 --- a/samples/client/petstore/java/resttemplate/docs/Animal.md +++ b/samples/client/petstore/java/resttemplate/docs/Animal.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate/docs/AnimalFarm.md b/samples/client/petstore/java/resttemplate/docs/AnimalFarm.md deleted file mode 100644 index c7c7f1ddcce..00000000000 --- a/samples/client/petstore/java/resttemplate/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ - -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - diff --git a/samples/client/petstore/java/resttemplate/docs/AnotherFakeApi.md b/samples/client/petstore/java/resttemplate/docs/AnotherFakeApi.md index 7a04619aaba..fb5c988e6cc 100644 --- a/samples/client/petstore/java/resttemplate/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/resttemplate/docs/AnotherFakeApi.md @@ -7,9 +7,11 @@ Method | HTTP request | Description [**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags + + # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -22,10 +24,13 @@ To test special tags //import io.swagger.client.api.AnotherFakeApi; + AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +42,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -52,3 +58,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + + diff --git a/samples/client/petstore/java/resttemplate/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/resttemplate/docs/ArrayOfArrayOfNumberOnly.md index 77292549927..3671a5e9190 100644 --- a/samples/client/petstore/java/resttemplate/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/java/resttemplate/docs/ArrayOfArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/resttemplate/docs/ArrayOfNumberOnly.md index e8cc4cd36dc..30b9b6648f4 100644 --- a/samples/client/petstore/java/resttemplate/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/java/resttemplate/docs/ArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate/docs/ArrayTest.md b/samples/client/petstore/java/resttemplate/docs/ArrayTest.md index 9feee16427f..4ab76343030 100644 --- a/samples/client/petstore/java/resttemplate/docs/ArrayTest.md +++ b/samples/client/petstore/java/resttemplate/docs/ArrayTest.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate/docs/Capitalization.md b/samples/client/petstore/java/resttemplate/docs/Capitalization.md index 0f3064c1996..9af7864f97e 100644 --- a/samples/client/petstore/java/resttemplate/docs/Capitalization.md +++ b/samples/client/petstore/java/resttemplate/docs/Capitalization.md @@ -13,3 +13,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate/docs/Cat.md b/samples/client/petstore/java/resttemplate/docs/Cat.md index 6e9f71ce7dd..5e408344021 100644 --- a/samples/client/petstore/java/resttemplate/docs/Cat.md +++ b/samples/client/petstore/java/resttemplate/docs/Cat.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **declawed** | **Boolean** | | [optional] + diff --git a/samples/client/petstore/java/resttemplate/docs/Category.md b/samples/client/petstore/java/resttemplate/docs/Category.md index e2df0803278..deb5a3e2a52 100644 --- a/samples/client/petstore/java/resttemplate/docs/Category.md +++ b/samples/client/petstore/java/resttemplate/docs/Category.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate/docs/ClassModel.md b/samples/client/petstore/java/resttemplate/docs/ClassModel.md index 64f880c8786..49c281cc0ed 100644 --- a/samples/client/petstore/java/resttemplate/docs/ClassModel.md +++ b/samples/client/petstore/java/resttemplate/docs/ClassModel.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate/docs/Client.md b/samples/client/petstore/java/resttemplate/docs/Client.md index 5c490ea166c..52b2f72c79c 100644 --- a/samples/client/petstore/java/resttemplate/docs/Client.md +++ b/samples/client/petstore/java/resttemplate/docs/Client.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate/docs/Dog.md b/samples/client/petstore/java/resttemplate/docs/Dog.md index ac7cea323ff..00e6446e9f5 100644 --- a/samples/client/petstore/java/resttemplate/docs/Dog.md +++ b/samples/client/petstore/java/resttemplate/docs/Dog.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **breed** | **String** | | [optional] + diff --git a/samples/client/petstore/java/resttemplate/docs/EnumArrays.md b/samples/client/petstore/java/resttemplate/docs/EnumArrays.md index 4dddc0bfd27..939a0e69587 100644 --- a/samples/client/petstore/java/resttemplate/docs/EnumArrays.md +++ b/samples/client/petstore/java/resttemplate/docs/EnumArrays.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] + ## Enum: JustSymbolEnum Name | Value @@ -20,8 +21,6 @@ DOLLAR | "$" ## Enum: List<ArrayEnumEnum> Name | Value ---- | ----- -FISH | "fish" -CRAB | "crab" diff --git a/samples/client/petstore/java/resttemplate/docs/EnumTest.md b/samples/client/petstore/java/resttemplate/docs/EnumTest.md index 08fee344882..9722c621962 100644 --- a/samples/client/petstore/java/resttemplate/docs/EnumTest.md +++ b/samples/client/petstore/java/resttemplate/docs/EnumTest.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] + ## Enum: EnumStringEnum Name | Value diff --git a/samples/client/petstore/java/resttemplate/docs/FakeApi.md b/samples/client/petstore/java/resttemplate/docs/FakeApi.md index 737ccc28293..6690b870e4e 100644 --- a/samples/client/petstore/java/resttemplate/docs/FakeApi.md +++ b/samples/client/petstore/java/resttemplate/docs/FakeApi.md @@ -15,6 +15,8 @@ Method | HTTP request | Description [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data + + # **fakeOuterBooleanSerialize** > Boolean fakeOuterBooleanSerialize(body) @@ -30,8 +32,11 @@ Test serialization of outer boolean types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body + +Boolean body = ; // Boolean | Input boolean as post body + try { Boolean result = apiInstance.fakeOuterBooleanSerialize(body); System.out.println(result); @@ -47,6 +52,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + ### Return type **Boolean** @@ -57,12 +63,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outercomposite) @@ -75,10 +82,13 @@ Test serialization of object with outer number type //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body + +OuterComposite 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 +100,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outercomposite** | [**OuterComposite**](.md)| Input composite as post body | [optional] + ### Return type @@ -102,8 +113,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterNumberSerialize** @@ -120,8 +132,11 @@ Test serialization of outer number types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body + +BigDecimal body = ; // BigDecimal | Input number as post body + try { BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); System.out.println(result); @@ -137,6 +152,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + ### Return type [**BigDecimal**](BigDecimal.md) @@ -147,8 +163,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterStringSerialize** @@ -165,8 +182,11 @@ Test serialization of outer string types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String body = "body_example"; // String | Input string as post body + +String body = ; // String | Input string as post body + try { String result = apiInstance.fakeOuterStringSerialize(body); System.out.println(result); @@ -182,6 +202,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**String**](String.md)| Input string as post body | [optional] + ### Return type **String** @@ -192,12 +213,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -210,10 +232,13 @@ To test \"client\" model //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +250,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -240,9 +266,10 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + # **testEndpointParameters** -> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) +> testEndpointParameters(body) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -251,36 +278,17 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### 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.FakeApi; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure HTTP basic authorization: http_basic_test -HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); -http_basic_test.setUsername("YOUR USERNAME"); -http_basic_test.setPassword("YOUR PASSWORD"); 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 -Integer integer = 56; // Integer | None -Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None -Float _float = 3.4F; // Float | None -String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None -LocalDate date = new LocalDate(); // LocalDate | None -OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None -String password = "password_example"; // String | None -String paramCallback = "paramCallback_example"; // String | None + +Object body = ; // Object | + try { - apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + apiInstance.testEndpointParameters(body); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEndpointParameters"); e.printStackTrace(); @@ -291,20 +299,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **BigDecimal**| None | - **_double** | **Double**| None | - **patternWithoutDelimiter** | **String**| None | - **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] - **int64** | **Long**| None | [optional] - **_float** | **Float**| None | [optional] - **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] - **date** | **LocalDate**| None | [optional] - **dateTime** | **OffsetDateTime**| None | [optional] - **password** | **String**| None | [optional] - **paramCallback** | **String**| None | [optional] + **body** | [**Object**](Object.md)| | + ### Return type @@ -317,11 +313,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 + - **Accept**: Not defined + # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger) To test enum parameters @@ -334,17 +331,23 @@ To test enum parameters //import io.swagger.client.api.FakeApi; + 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) + +Object body = ; // Object | + List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) -String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + +String enumHeaderString = Arrays.asList("enumHeaderString_example"); // 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) + +String enumQueryString = Arrays.asList("enumQueryString_example"); // String | Query parameter enum test (string) + +Integer enumQueryInteger = Arrays.asList(56); // Integer | Query parameter enum test (double) + try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -355,14 +358,13 @@ 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] + **body** | [**Object**](Object.md)| | [optional] + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: ] + **enumHeaderString** | [**String**](.md)| Header parameter enum test (string) | [optional] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: ] + **enumQueryString** | [**String**](.md)| Query parameter enum test (string) | [optional] + **enumQueryInteger** | [**Integer**](.md)| Query parameter enum test (double) | [optional] + ### Return type @@ -375,16 +377,15 @@ No authorization required ### HTTP request headers - **Content-Type**: */* - - **Accept**: */* + - **Accept**: Not defined + # **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(body) test inline additionalProperties - - ### Example ```java // Import classes: @@ -392,10 +393,13 @@ test inline additionalProperties //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body + +Map body = ; // Map | request body + try { - apiInstance.testInlineAdditionalProperties(param); + apiInstance.testInlineAdditionalProperties(body); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); e.printStackTrace(); @@ -406,7 +410,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **body** | [**Map<String, String>**](Map.md)| request body | + ### Return type @@ -421,14 +426,13 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined + # **testJsonFormData** -> testJsonFormData(param, param2) +> testJsonFormData(body) test json serialization of form data - - ### Example ```java // Import classes: @@ -436,11 +440,13 @@ test json serialization of form data //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String param = "param_example"; // String | field1 -String param2 = "param2_example"; // String | field2 + +Object body = ; // Object | + try { - apiInstance.testJsonFormData(param, param2); + apiInstance.testJsonFormData(body); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testJsonFormData"); e.printStackTrace(); @@ -451,8 +457,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **String**| field1 | - **param2** | **String**| field2 | + **body** | [**Object**](Object.md)| | + ### Return type @@ -467,3 +473,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined + + diff --git a/samples/client/petstore/java/resttemplate/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/resttemplate/docs/FakeClassnameTags123Api.md index bc728bfce5b..2bcbbb7908f 100644 --- a/samples/client/petstore/java/resttemplate/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/resttemplate/docs/FakeClassnameTags123Api.md @@ -7,33 +7,28 @@ Method | HTTP request | Description [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case ### 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.FakeClassnameTags123Api; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure API key authorization: api_key_query -ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); -api_key_query.setApiKey("YOUR API KEY"); -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model + +Client 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 +40,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -60,3 +56,5 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + + diff --git a/samples/client/petstore/java/resttemplate/docs/FormatTest.md b/samples/client/petstore/java/resttemplate/docs/FormatTest.md index c7a3acb3cb7..bc11b93cb26 100644 --- a/samples/client/petstore/java/resttemplate/docs/FormatTest.md +++ b/samples/client/petstore/java/resttemplate/docs/FormatTest.md @@ -11,8 +11,8 @@ Name | Type | Description | Notes **_float** | **Float** | | [optional] **_double** | **Double** | | [optional] **string** | **String** | | [optional] -**_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**_byte** | **String** | | +**binary** | **String** | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] @@ -20,3 +20,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/resttemplate/docs/HasOnlyReadOnly.md index c1d0aac5672..5564ddcf28a 100644 --- a/samples/client/petstore/java/resttemplate/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/java/resttemplate/docs/HasOnlyReadOnly.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate/docs/MapTest.md b/samples/client/petstore/java/resttemplate/docs/MapTest.md index 714a97a40d9..74a6fe8ae70 100644 --- a/samples/client/petstore/java/resttemplate/docs/MapTest.md +++ b/samples/client/petstore/java/resttemplate/docs/MapTest.md @@ -8,12 +8,11 @@ Name | Type | Description | Notes **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] + ## Enum: Map<String, InnerEnum> Name | Value ---- | ----- -UPPER | "UPPER" -LOWER | "lower" diff --git a/samples/client/petstore/java/resttemplate/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/resttemplate/docs/MixedPropertiesAndAdditionalPropertiesClass.md index b12e2cd70e6..4507481b5a9 100644 --- a/samples/client/petstore/java/resttemplate/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/resttemplate/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate/docs/Model200Response.md b/samples/client/petstore/java/resttemplate/docs/Model200Response.md index 5b3a9a0e46d..8d2cc50bb83 100644 --- a/samples/client/petstore/java/resttemplate/docs/Model200Response.md +++ b/samples/client/petstore/java/resttemplate/docs/Model200Response.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate/docs/ModelApiResponse.md b/samples/client/petstore/java/resttemplate/docs/ModelApiResponse.md index 3eec8686cc9..06052b202f1 100644 --- a/samples/client/petstore/java/resttemplate/docs/ModelApiResponse.md +++ b/samples/client/petstore/java/resttemplate/docs/ModelApiResponse.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate/docs/ModelReturn.md b/samples/client/petstore/java/resttemplate/docs/ModelReturn.md index a679b04953e..a7845ba254b 100644 --- a/samples/client/petstore/java/resttemplate/docs/ModelReturn.md +++ b/samples/client/petstore/java/resttemplate/docs/ModelReturn.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate/docs/Name.md b/samples/client/petstore/java/resttemplate/docs/Name.md index ce2fb4dee50..a8d6fec9714 100644 --- a/samples/client/petstore/java/resttemplate/docs/Name.md +++ b/samples/client/petstore/java/resttemplate/docs/Name.md @@ -11,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate/docs/NumberOnly.md b/samples/client/petstore/java/resttemplate/docs/NumberOnly.md index a3feac7fadc..adfb36a95bb 100644 --- a/samples/client/petstore/java/resttemplate/docs/NumberOnly.md +++ b/samples/client/petstore/java/resttemplate/docs/NumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate/docs/Order.md b/samples/client/petstore/java/resttemplate/docs/Order.md index 268c617d1ff..7e4beff6df1 100644 --- a/samples/client/petstore/java/resttemplate/docs/Order.md +++ b/samples/client/petstore/java/resttemplate/docs/Order.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/resttemplate/docs/OuterComposite.md b/samples/client/petstore/java/resttemplate/docs/OuterComposite.md index 3f5a633c998..1963c7a0f73 100644 --- a/samples/client/petstore/java/resttemplate/docs/OuterComposite.md +++ b/samples/client/petstore/java/resttemplate/docs/OuterComposite.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate/docs/Pet.md b/samples/client/petstore/java/resttemplate/docs/Pet.md index 5b63109ef92..1492195a58d 100644 --- a/samples/client/petstore/java/resttemplate/docs/Pet.md +++ b/samples/client/petstore/java/resttemplate/docs/Pet.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/resttemplate/docs/PetApi.md b/samples/client/petstore/java/resttemplate/docs/PetApi.md index b5fa395947d..4758743434a 100644 --- a/samples/client/petstore/java/resttemplate/docs/PetApi.md +++ b/samples/client/petstore/java/resttemplate/docs/PetApi.md @@ -14,33 +14,28 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image + + # **addPet** -> addPet(body) +> addPet(pet) 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 + +Pet 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 +46,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -64,7 +60,8 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **deletePet** @@ -72,26 +69,20 @@ null (empty response body) 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 | + +Integer petId = Arrays.asList(56); // Integer | Pet id to delete + +String apiKey = Arrays.asList("apiKey_example"); // String | + try { apiInstance.deletePet(petId, apiKey); } catch (ApiException e) { @@ -104,8 +95,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | - **apiKey** | **String**| | [optional] + **petId** | [**Integer**](.md)| Pet id to delete | + **apiKey** | [**String**](.md)| | [optional] + ### Return type @@ -118,7 +110,8 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **findPetsByStatus** @@ -131,20 +124,15 @@ 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); @@ -158,7 +146,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: ] + ### Return type @@ -173,6 +162,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **findPetsByTags** > List<Pet> findPetsByTags(tags) @@ -184,20 +174,15 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### 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); @@ -213,6 +198,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | + ### Return type [**List<Pet>**](Pet.md) @@ -226,6 +212,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **getPetById** > Pet getPetById(petId) @@ -237,22 +224,15 @@ 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to return + try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -266,7 +246,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to return | + **petId** | [**Integer**](.md)| ID of pet to return | + ### Return type @@ -281,33 +262,27 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **updatePet** -> updatePet(body) +> updatePet(pet) 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 + +Pet 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 +293,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -331,37 +307,31 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updatePetWithForm** -> updatePetWithForm(petId, name, status) +> updatePetWithForm(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet that needs to be updated + +Object body = ; // Object | + try { - apiInstance.updatePetWithForm(petId, name, status); + apiInstance.updatePetWithForm(petId, body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePetWithForm"); e.printStackTrace(); @@ -372,9 +342,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet that needs to be updated | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -387,37 +357,31 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **uploadFile** -> ModelApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to update + +Object body = ; // Object | + try { - ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); + ModelApiResponse result = apiInstance.uploadFile(petId, body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFile"); @@ -429,9 +393,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet to update | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -446,3 +410,5 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json + + diff --git a/samples/client/petstore/java/resttemplate/docs/ReadOnlyFirst.md b/samples/client/petstore/java/resttemplate/docs/ReadOnlyFirst.md index 426b7cde95a..57655e5b49e 100644 --- a/samples/client/petstore/java/resttemplate/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/java/resttemplate/docs/ReadOnlyFirst.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate/docs/SpecialModelName.md b/samples/client/petstore/java/resttemplate/docs/SpecialModelName.md index c2c6117c552..f4259d2a73c 100644 --- a/samples/client/petstore/java/resttemplate/docs/SpecialModelName.md +++ b/samples/client/petstore/java/resttemplate/docs/SpecialModelName.md @@ -4,7 +4,8 @@ ## 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..a4678ee745c 100644 --- a/samples/client/petstore/java/resttemplate/docs/StoreApi.md +++ b/samples/client/petstore/java/resttemplate/docs/StoreApi.md @@ -10,6 +10,8 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + # **deleteOrder** > deleteOrder(orderId) @@ -25,8 +27,11 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + +String orderId = Arrays.asList("orderId_example"); // String | ID of the order that needs to be deleted + try { apiInstance.deleteOrder(orderId); } catch (ApiException e) { @@ -39,7 +44,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | + **orderId** | [**String**](.md)| ID of the order that needs to be deleted | + ### Return type @@ -52,7 +58,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getInventory** @@ -65,21 +72,13 @@ 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); @@ -92,6 +91,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type **Map<String, Integer>** @@ -105,6 +105,7 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json + # **getOrderById** > Order getOrderById(orderId) @@ -120,8 +121,11 @@ For valid response try integer IDs with value <= 5 or > 10. Other val //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched + +Integer orderId = Arrays.asList(56); // Integer | ID of pet that needs to be fetched + try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +139,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | [**Integer**](.md)| ID of pet that needs to be fetched | + ### Return type @@ -150,14 +155,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -165,10 +169,13 @@ Place an order for a pet //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet + +Order 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 +187,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](.md)| order placed for purchasing the pet | + ### Return type @@ -192,6 +200,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: */* - **Accept**: application/xml, application/json + + diff --git a/samples/client/petstore/java/resttemplate/docs/Tag.md b/samples/client/petstore/java/resttemplate/docs/Tag.md index de6814b55d5..7a97d4c6812 100644 --- a/samples/client/petstore/java/resttemplate/docs/Tag.md +++ b/samples/client/petstore/java/resttemplate/docs/Tag.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate/docs/User.md b/samples/client/petstore/java/resttemplate/docs/User.md index 8b6753dd284..cf7f9ce1312 100644 --- a/samples/client/petstore/java/resttemplate/docs/User.md +++ b/samples/client/petstore/java/resttemplate/docs/User.md @@ -15,3 +15,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/resttemplate/docs/UserApi.md b/samples/client/petstore/java/resttemplate/docs/UserApi.md index 2e6987951c8..e421376ce79 100644 --- a/samples/client/petstore/java/resttemplate/docs/UserApi.md +++ b/samples/client/petstore/java/resttemplate/docs/UserApi.md @@ -14,9 +14,11 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + # **createUser** -> createUser(body) +> createUser(user) Create user @@ -29,10 +31,13 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object + +User 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 +48,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](.md)| Created user object | + ### Return type @@ -55,8 +61,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithArrayInput** @@ -64,8 +71,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -73,8 +78,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -89,6 +97,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type null (empty response body) @@ -99,8 +108,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithListInput** @@ -108,8 +118,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -117,8 +125,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { @@ -133,6 +144,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type null (empty response body) @@ -143,8 +155,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **deleteUser** @@ -161,8 +174,11 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be deleted + +String username = Arrays.asList("username_example"); // String | The name that needs to be deleted + try { apiInstance.deleteUser(username); } catch (ApiException e) { @@ -175,7 +191,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | + **username** | [**String**](.md)| The name that needs to be deleted | + ### Return type @@ -188,7 +205,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getUserByName** @@ -196,8 +214,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -205,8 +221,11 @@ Get user by user name //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. + +String username = Arrays.asList("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 +239,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + **username** | [**String**](.md)| The name that needs to be fetched. Use user1 for testing. | + ### Return type @@ -235,14 +255,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **loginUser** > String loginUser(username, password) Logs user into the system - - ### Example ```java // Import classes: @@ -250,9 +269,13 @@ Logs user into the system //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 + +String username = Arrays.asList("username_example"); // String | The user name for login + +String password = Arrays.asList("password_example"); // String | The password for login in clear text + try { String result = apiInstance.loginUser(username, password); System.out.println(result); @@ -266,8 +289,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | + **username** | [**String**](.md)| The user name for login | + **password** | [**String**](.md)| The password for login in clear text | + ### Return type @@ -282,14 +306,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **logoutUser** > logoutUser() Logs out current logged in user session - - ### Example ```java // Import classes: @@ -297,7 +320,9 @@ Logs out current logged in user session //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); + try { apiInstance.logoutUser(); } catch (ApiException e) { @@ -309,6 +334,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type null (empty response body) @@ -320,11 +346,12 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updateUser** -> updateUser(username, body) +> updateUser(user, username) Updated user @@ -337,11 +364,15 @@ This can only be done by the logged in user. //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 + +User user = ; // User | Updated user object + +String username = Arrays.asList("username_example"); // String | name that need to be deleted + try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(user, username); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -352,8 +383,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](.md)| Updated user object | + **username** | [**String**](.md)| name that need to be deleted | + ### Return type @@ -365,6 +397,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + + diff --git a/samples/client/petstore/java/resttemplate/git_push.sh b/samples/client/petstore/java/resttemplate/git_push.sh index ae01b182ae9..ed374619b13 100644 --- a/samples/client/petstore/java/resttemplate/git_push.sh +++ b/samples/client/petstore/java/resttemplate/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 credential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential 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/resttemplate/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/resttemplate/gradle/wrapper/gradle-wrapper.jar index 2c6137b8789..e69de29bb2d 100644 Binary files a/samples/client/petstore/java/resttemplate/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/resttemplate/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/resttemplate/pom.xml b/samples/client/petstore/java/resttemplate/pom.xml index e845be65bde..7127f4f8270 100644 --- a/samples/client/petstore/java/resttemplate/pom.xml +++ b/samples/client/petstore/java/resttemplate/pom.xml @@ -1,258 +1,249 @@ - 4.0.0 - io.swagger - swagger-petstore-resttemplate - jar - swagger-petstore-resttemplate - 1.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-petstore-resttemplate + jar + swagger-petstore-resttemplate + 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 - 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 + - - - 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 - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - 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.2 - - - - jar - test-jar - - - - - - + + + + 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.codehaus.mojo - build-helper-maven-plugin - 1.10 - - - 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.7 - 1.7 - - - - 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 - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + 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.7 + 1.7 + + + + + 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-annotations-version} - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + - - - org.springframework - spring-web - ${spring-web-version} - + + + io.swagger + swagger-annotations + ${swagger-annotations-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.jaxrs - jackson-jaxrs-json-provider - ${jackson-version} - - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-threetenbp-version} - + + + org.springframework + spring-web + ${spring-web-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.jaxrs + jackson-jaxrs-json-provider + ${jackson-version} + + + + + + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${jackson-threetenbp-version} + + - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.5.15 - 4.3.9.RELEASE - 2.8.9 - 2.6.4 - 1.0.0 - 4.12 - + + + junit + junit + ${junit-version} + test + + + + UTF-8 + 1.5.15 + 4.3.9.RELEASE + 2.8.9 + + + 2.6.4 + + 1.0.0 + 4.12 + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/ApiClient.java index b905f6a27c4..b77160c20c9 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/ApiClient.java @@ -1,5 +1,6 @@ package io.swagger.client; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -17,6 +18,7 @@ import org.springframework.http.client.ClientHttpRequestExecution; import org.springframework.http.client.ClientHttpRequestInterceptor; import org.springframework.http.client.ClientHttpResponse; + import org.springframework.stereotype.Component; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; @@ -24,12 +26,14 @@ import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; import org.springframework.web.util.UriComponentsBuilder; + import org.threeten.bp.*; import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter; import com.fasterxml.jackson.databind.ObjectMapper; + import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -109,11 +113,11 @@ protected void init() { setUserAgent("Java-SDK"); // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); - authentications.put("api_key", new ApiKeyAuth("header", "api_key")); - authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); - authentications.put("http_basic_test", new HttpBasicAuth()); - authentications.put("petstore_auth", new OAuth()); + authentications = new HashMap(); + authentications.put("api_key", new ApiKeyAuth("header", "api_key")); + authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); + authentications.put("http_basic_test", new HttpBasicAuth()); + authentications.put("petstore_auth", new OAuth()); // Prevent the authentications from being modified. authentications = Collections.unmodifiableMap(authentications); } @@ -258,9 +262,6 @@ public ApiClient setUserAgent(String userAgent) { * @return ApiClient this client */ public ApiClient addDefaultHeader(String name, String value) { - if (defaultHeaders.containsKey(name)) { - defaultHeaders.remove(name); - } defaultHeaders.add(name, value); return this; } @@ -312,12 +313,14 @@ public DateFormat getDateFormat() { */ public ApiClient setDateFormat(DateFormat dateFormat) { this.dateFormat = dateFormat; + for(HttpMessageConverter converter:restTemplate.getMessageConverters()){ if(converter instanceof AbstractJackson2HttpMessageConverter){ ObjectMapper mapper = ((AbstractJackson2HttpMessageConverter)converter).getObjectMapper(); mapper.setDateFormat(dateFormat); } } + return this; } @@ -571,6 +574,7 @@ protected void addHeadersToRequest(HttpHeaders headers, BodyBuilder requestBuild */ protected RestTemplate buildRestTemplate() { RestTemplate restTemplate = new RestTemplate(); + for(HttpMessageConverter converter:restTemplate.getMessageConverters()){ if(converter instanceof AbstractJackson2HttpMessageConverter){ ObjectMapper mapper = ((AbstractJackson2HttpMessageConverter)converter).getObjectMapper(); @@ -581,6 +585,7 @@ protected RestTemplate buildRestTemplate() { mapper.registerModule(module); } } + // This allows us to read the response more than once - Necessary for debugging. restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(restTemplate.getRequestFactory())); return restTemplate; 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..e4074541d5f 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 @@ -4,6 +4,7 @@ import io.swagger.client.model.Client; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -25,6 +26,7 @@ @Component("io.swagger.client.api.AnotherFakeApi") + public class AnotherFakeApi { private ApiClient apiClient; @@ -45,20 +47,22 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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(); @@ -69,11 +73,11 @@ public Client testSpecialTags(Client body) throws RestClientException { final String[] accepts = { "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -81,4 +85,6 @@ public Client testSpecialTags(Client body) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + } + 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..2a1b8946dfb 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,10 +4,9 @@ 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 java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -29,6 +28,7 @@ @Component("io.swagger.client.api.FakeApi") + public class FakeApi { private ApiClient apiClient; @@ -49,6 +49,7 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * * Test serialization of outer boolean types @@ -56,6 +57,7 @@ public void setApiClient(ApiClient apiClient) { * @param body 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; @@ -66,9 +68,13 @@ public Boolean fakeOuterBooleanSerialize(Boolean body) throws RestClientExceptio 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 String[] contentTypes = { + "*/*" + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -76,16 +82,18 @@ public Boolean fakeOuterBooleanSerialize(Boolean body) throws RestClientExceptio ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * * 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,9 +101,13 @@ public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Re 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 String[] contentTypes = { + "*/*" + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -103,6 +115,7 @@ public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Re ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * * Test serialization of outer number types @@ -110,6 +123,7 @@ public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Re * @param body Input number as post body * @return BigDecimal * @throws RestClientException if an error occurs while attempting to invoke the API + */ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws RestClientException { Object postBody = body; @@ -120,9 +134,13 @@ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws RestClientExc 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 String[] contentTypes = { + "*/*" + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -130,6 +148,7 @@ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws RestClientExc ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * * Test serialization of outer string types @@ -137,6 +156,7 @@ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws RestClientExc * @param body Input string as post body * @return String * @throws RestClientException if an error occurs while attempting to invoke the API + */ public String fakeOuterStringSerialize(String body) throws RestClientException { Object postBody = body; @@ -147,9 +167,13 @@ public String fakeOuterStringSerialize(String body) throws RestClientException { 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 String[] contentTypes = { + "*/*" + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -157,20 +181,22 @@ public String fakeOuterStringSerialize(String body) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.POST, 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(); @@ -181,11 +207,11 @@ public Client testClientModel(Client body) throws RestClientException { final String[] accepts = { "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -193,48 +219,22 @@ public Client testClientModel(Client body) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *

400 - Invalid username supplied *

404 - User not found - * @param number None - * @param _double None - * @param patternWithoutDelimiter None - * @param _byte None - * @param integer None - * @param int32 None - * @param int64 None - * @param _float None - * @param string None - * @param binary None - * @param date None - * @param dateTime None - * @param password None - * @param paramCallback None + * @param body The body parameter * @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 { - Object postBody = null; - - // verify the required parameter 'number' is set - if (number == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'number' when calling testEndpointParameters"); - } - - // verify the required parameter '_double' is set - if (_double == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter '_double' when calling testEndpointParameters"); - } - - // verify the required parameter 'patternWithoutDelimiter' is set - if (patternWithoutDelimiter == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); - } + public void testEndpointParameters(Object body) throws RestClientException { + Object postBody = body; - // verify the required parameter '_byte' is set - if (_byte == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter '_byte' when calling testEndpointParameters"); + // verify the required parameter 'body' is set + if (body == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testEndpointParameters"); } String path = UriComponentsBuilder.fromPath("/fake").build().toUriString(); @@ -242,43 +242,12 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - - if (integer != null) - formParams.add("integer", integer); - if (int32 != null) - formParams.add("int32", int32); - if (int64 != null) - formParams.add("int64", int64); - if (number != null) - formParams.add("number", number); - if (_float != null) - formParams.add("float", _float); - if (_double != null) - formParams.add("double", _double); - if (string != null) - formParams.add("string", string); - if (patternWithoutDelimiter != null) - formParams.add("pattern_without_delimiter", patternWithoutDelimiter); - if (_byte != null) - formParams.add("byte", _byte); - if (binary != null) - formParams.add("binary", binary); - if (date != null) - formParams.add("date", date); - if (dateTime != null) - formParams.add("dateTime", dateTime); - if (password != null) - formParams.add("password", password); - 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/xml; charset=utf-8", "application/json; charset=utf-8" + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "http_basic_test" }; @@ -286,23 +255,23 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * To test enum parameters * 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 body The body parameter * @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) * @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 { - Object postBody = null; + public void testEnumParameters(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger) throws RestClientException { + Object postBody = body; String path = UriComponentsBuilder.fromPath("/fake").build().toUriString(); @@ -310,7 +279,7 @@ public void testEnumParameters(List enumFormStringArray, String enumForm final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase()), "enum_query_string_array", enumQueryStringArray)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_string_array", enumQueryStringArray)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_string", enumQueryString)); queryParams.putAll(apiClient.parameterToMultiValueMap(null, "enum_query_integer", enumQueryInteger)); @@ -318,21 +287,12 @@ public void testEnumParameters(List enumFormStringArray, String enumForm headerParams.add("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); if (enumHeaderString != null) headerParams.add("enum_header_string", apiClient.parameterToString(enumHeaderString)); - - if (enumFormStringArray != null) - 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 = { "*/*" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -340,19 +300,21 @@ public void testEnumParameters(List enumFormStringArray, String enumForm ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * test inline additionalProperties * *

200 - successful operation - * @param param request body + * @param body 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(Map body) throws RestClientException { + Object postBody = body; - // 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 'body' is set + if (body == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testInlineAdditionalProperties"); } String path = UriComponentsBuilder.fromPath("/fake/inline-additionalProperties").build().toUriString(); @@ -361,11 +323,11 @@ public void testInlineAdditionalProperties(Object param) throws RestClientExcept 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 = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -373,25 +335,21 @@ public void testInlineAdditionalProperties(Object param) throws RestClientExcept ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * test json serialization of form data * *

200 - successful operation - * @param param field1 - * @param param2 field2 + * @param body The body parameter * @throws RestClientException if an error occurs while attempting to invoke the API + */ - public void testJsonFormData(String param, String param2) throws RestClientException { - Object postBody = null; - - // verify the required parameter 'param' is set - if (param == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param' when calling testJsonFormData"); - } + public void testJsonFormData(Object body) throws RestClientException { + Object postBody = body; - // verify the required parameter 'param2' is set - if (param2 == null) { - throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'param2' when calling testJsonFormData"); + // verify the required parameter 'body' is set + if (body == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'body' when calling testJsonFormData"); } String path = UriComponentsBuilder.fromPath("/fake/jsonFormData").build().toUriString(); @@ -399,17 +357,12 @@ public void testJsonFormData(String param, String param2) throws RestClientExcep final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - - if (param != null) - formParams.add("param", param); - if (param2 != null) - formParams.add("param2", param2); - final String[] accepts = { }; + final String[] accepts = { }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -417,4 +370,6 @@ public void testJsonFormData(String param, String param2) throws RestClientExcep ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + } + 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 59eaddcedbe..07c86b37632 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 @@ -4,6 +4,7 @@ import io.swagger.client.model.Client; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -25,6 +26,7 @@ @Component("io.swagger.client.api.FakeClassnameTags123Api") + public class FakeClassnameTags123Api { private ApiClient apiClient; @@ -45,20 +47,22 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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(); @@ -69,11 +73,11 @@ public Client testClassname(Client body) throws RestClientException { final String[] accepts = { "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { "application/json" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "api_key_query" }; @@ -81,4 +85,6 @@ public Client testClassname(Client body) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.PATCH, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + } + 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..eda24aaaaa1 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 @@ -2,10 +2,10 @@ import io.swagger.client.ApiClient; -import java.io.File; import io.swagger.client.model.ModelApiResponse; import io.swagger.client.model.Pet; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -27,6 +27,7 @@ @Component("io.swagger.client.api.PetApi") + public class PetApi { private ApiClient apiClient; @@ -47,19 +48,21 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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,13 +71,11 @@ public void addPet(Pet body) throws RestClientException { 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" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; @@ -82,6 +83,7 @@ public void addPet(Pet body) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Deletes a pet * @@ -89,8 +91,9 @@ public void addPet(Pet body) throws RestClientException { * @param petId Pet id to delete * @param apiKey The apiKey parameter * @throws RestClientException if an error occurs while attempting to invoke the API + */ - public void deletePet(Long petId, String apiKey) throws RestClientException { + public void deletePet(Integer petId, String apiKey) throws RestClientException { Object postBody = null; // verify the required parameter 'petId' is set @@ -110,11 +113,9 @@ public void deletePet(Long petId, String apiKey) throws RestClientException { 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 String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; @@ -122,6 +123,7 @@ public void deletePet(Long petId, String apiKey) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -130,6 +132,7 @@ public void deletePet(Long petId, String apiKey) throws RestClientException { * @param status Status values that need to be considered for filter * @return List<Pet> * @throws RestClientException if an error occurs while attempting to invoke the API + */ public List findPetsByStatus(List status) throws RestClientException { Object postBody = null; @@ -145,13 +148,13 @@ public List findPetsByStatus(List status) throws RestClientExceptio final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase()), "status", status)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "status", status)); final String[] accepts = { "application/xml", "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; @@ -159,6 +162,7 @@ public List findPetsByStatus(List status) throws RestClientExceptio ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. @@ -167,6 +171,7 @@ public List findPetsByStatus(List status) throws RestClientExceptio * @param tags Tags to filter by * @return List<Pet> * @throws RestClientException if an error occurs while attempting to invoke the API + */ public List findPetsByTags(List tags) throws RestClientException { Object postBody = null; @@ -182,13 +187,13 @@ public List findPetsByTags(List tags) throws RestClientException { final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - queryParams.putAll(apiClient.parameterToMultiValueMap(ApiClient.CollectionFormat.valueOf("csv".toUpperCase()), "tags", tags)); + queryParams.putAll(apiClient.parameterToMultiValueMap(null, "tags", tags)); final String[] accepts = { "application/xml", "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; @@ -196,6 +201,7 @@ public List findPetsByTags(List tags) throws RestClientException { ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Find pet by ID * Returns a single pet @@ -205,8 +211,9 @@ public List findPetsByTags(List tags) throws RestClientException { * @param petId ID of pet to return * @return Pet * @throws RestClientException if an error occurs while attempting to invoke the API + */ - public Pet getPetById(Long petId) throws RestClientException { + public Pet getPetById(Integer petId) throws RestClientException { Object postBody = null; // verify the required parameter 'petId' is set @@ -225,9 +232,9 @@ public Pet getPetById(Long petId) throws RestClientException { final String[] accepts = { "application/xml", "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "api_key" }; @@ -235,21 +242,23 @@ public Pet getPetById(Long petId) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * 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 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,13 +267,11 @@ public void updatePet(Pet body) throws RestClientException { 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" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; @@ -272,17 +279,18 @@ public void updatePet(Pet body) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * 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 - * @param status Updated status of the pet + * @param body The body parameter * @throws RestClientException if an error occurs while attempting to invoke the API + */ - public void updatePetWithForm(Long petId, String name, String status) throws RestClientException { - Object postBody = null; + public void updatePetWithForm(Integer petId, Object body) throws RestClientException { + Object postBody = body; // verify the required parameter 'petId' is set if (petId == null) { @@ -297,19 +305,12 @@ public void updatePetWithForm(Long petId, String name, String status) throws Res final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - - if (name != null) - formParams.add("name", name); - 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" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; @@ -317,18 +318,19 @@ public void updatePetWithForm(Long petId, String name, String status) throws Res ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * uploads an image * *

200 - successful operation * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload + * @param body The body parameter * @return ModelApiResponse * @throws RestClientException if an error occurs while attempting to invoke the API + */ - public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws RestClientException { - Object postBody = null; + public ModelApiResponse uploadFile(Integer petId, Object body) throws RestClientException { + Object postBody = body; // verify the required parameter 'petId' is set if (petId == null) { @@ -343,19 +345,14 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f final MultiValueMap queryParams = new LinkedMultiValueMap(); final HttpHeaders headerParams = new HttpHeaders(); final MultiValueMap formParams = new LinkedMultiValueMap(); - - if (additionalMetadata != null) - formParams.add("additionalMetadata", additionalMetadata); - if (file != null) - formParams.add("file", new FileSystemResource(file)); final String[] accepts = { "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); final String[] contentTypes = { "multipart/form-data" - }; + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "petstore_auth" }; @@ -363,4 +360,6 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + } + 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..f640e5c8d13 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 @@ -4,6 +4,7 @@ import io.swagger.client.model.Order; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -25,6 +26,7 @@ @Component("io.swagger.client.api.StoreApi") + public class StoreApi { private ApiClient apiClient; @@ -45,6 +47,7 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -52,6 +55,7 @@ public void setApiClient(ApiClient apiClient) { *

404 - Order not found * @param orderId ID of the order that needs to be deleted * @throws RestClientException if an error occurs while attempting to invoke the API + */ public void deleteOrder(String orderId) throws RestClientException { Object postBody = null; @@ -70,11 +74,9 @@ public void deleteOrder(String orderId) throws RestClientException { 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 String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -82,12 +84,14 @@ public void deleteOrder(String orderId) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Returns pet inventories by status * Returns a map of status codes to quantities *

200 - successful operation * @return Map<String, Integer> * @throws RestClientException if an error occurs while attempting to invoke the API + */ public Map getInventory() throws RestClientException { Object postBody = null; @@ -100,9 +104,9 @@ public Map getInventory() throws RestClientException { final String[] accepts = { "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { "api_key" }; @@ -110,6 +114,7 @@ public Map getInventory() throws RestClientException { ParameterizedTypeReference> returnType = new ParameterizedTypeReference>() {}; return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -119,8 +124,9 @@ public Map getInventory() throws RestClientException { * @param orderId ID of pet that needs to be fetched * @return Order * @throws RestClientException if an error occurs while attempting to invoke the API + */ - public Order getOrderById(Long orderId) throws RestClientException { + public Order getOrderById(Integer orderId) throws RestClientException { Object postBody = null; // verify the required parameter 'orderId' is set @@ -139,9 +145,9 @@ public Order getOrderById(Long orderId) throws RestClientException { final String[] accepts = { "application/xml", "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -149,21 +155,23 @@ public Order getOrderById(Long orderId) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * 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 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(); @@ -174,9 +182,11 @@ public Order placeOrder(Order body) throws RestClientException { final String[] accepts = { "application/xml", "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] contentTypes = { + "*/*" + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -184,4 +194,6 @@ public Order placeOrder(Order body) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + } + 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 3e2d1ac00af..26157643ea4 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 @@ -4,6 +4,7 @@ import io.swagger.client.model.User; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -25,6 +26,7 @@ @Component("io.swagger.client.api.UserApi") + public class UserApi { private ApiClient apiClient; @@ -45,19 +47,21 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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,11 +70,11 @@ public void createUser(User body) throws RestClientException { 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 String[] contentTypes = { + "*/*" + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -78,12 +82,14 @@ public void createUser(User body) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Creates list of users with given input array * *

0 - successful operation * @param body 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; @@ -99,11 +105,11 @@ public void createUsersWithArrayInput(List body) throws RestClientExceptio 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 String[] contentTypes = { + "*/*" + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -111,12 +117,14 @@ public void createUsersWithArrayInput(List body) throws RestClientExceptio ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Creates list of users with given input array * *

0 - successful operation * @param body 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; @@ -132,11 +140,11 @@ public void createUsersWithListInput(List body) throws RestClientException 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 String[] contentTypes = { + "*/*" + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -144,6 +152,7 @@ public void createUsersWithListInput(List body) throws RestClientException ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.POST, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Delete user * This can only be done by the logged in user. @@ -151,6 +160,7 @@ public void createUsersWithListInput(List body) throws RestClientException *

404 - User not found * @param username The name that needs to be deleted * @throws RestClientException if an error occurs while attempting to invoke the API + */ public void deleteUser(String username) throws RestClientException { Object postBody = null; @@ -169,11 +179,9 @@ public void deleteUser(String username) throws RestClientException { 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 String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -181,6 +189,7 @@ public void deleteUser(String username) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.DELETE, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Get user by user name * @@ -190,6 +199,7 @@ public void deleteUser(String username) throws RestClientException { * @param username The name that needs to be fetched. Use user1 for testing. * @return User * @throws RestClientException if an error occurs while attempting to invoke the API + */ public User getUserByName(String username) throws RestClientException { Object postBody = null; @@ -210,9 +220,9 @@ public User getUserByName(String username) throws RestClientException { final String[] accepts = { "application/xml", "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -220,6 +230,7 @@ public User getUserByName(String username) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Logs user into the system * @@ -229,6 +240,7 @@ public User getUserByName(String username) throws RestClientException { * @param password The password for login in clear text * @return String * @throws RestClientException if an error occurs while attempting to invoke the API + */ public String loginUser(String username, String password) throws RestClientException { Object postBody = null; @@ -254,9 +266,9 @@ public String loginUser(String username, String password) throws RestClientExcep final String[] accepts = { "application/xml", "application/json" - }; + }; final List accept = apiClient.selectHeaderAccept(accepts); - final String[] contentTypes = { }; + final String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -264,11 +276,13 @@ public String loginUser(String username, String password) throws RestClientExcep ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; return apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Logs out current logged in user session * *

0 - successful operation * @throws RestClientException if an error occurs while attempting to invoke the API + */ public void logoutUser() throws RestClientException { Object postBody = null; @@ -279,11 +293,9 @@ public void logoutUser() throws RestClientException { 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 String[] contentTypes = { }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -291,28 +303,30 @@ public void logoutUser() throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.GET, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + /** * Updated user * This can only be done by the logged in user. *

400 - Invalid user supplied *

404 - User not found + * @param user Updated user object * @param username name that need to be deleted - * @param body 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(User user, String username) throws RestClientException { + Object postBody = user; + + // verify the required parameter 'user' is set + if (user == null) { + throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'user' when calling updateUser"); + } // 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"); - } - // create path and map variables final Map uriVariables = new HashMap(); uriVariables.put("username", username); @@ -322,11 +336,11 @@ public void updateUser(String username, User body) throws RestClientException { 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 String[] contentTypes = { + "*/*" + }; final MediaType contentType = apiClient.selectHeaderContentType(contentTypes); String[] authNames = new String[] { }; @@ -334,4 +348,6 @@ public void updateUser(String username, User body) throws RestClientException { ParameterizedTypeReference returnType = new ParameterizedTypeReference() {}; apiClient.invokeAPI(path, HttpMethod.PUT, queryParams, postBody, headerParams, formParams, accept, contentType, authNames, returnType); } + } + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 7fe69e168fd..c226acf8619 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -28,65 +28,65 @@ */ public class AdditionalPropertiesClass { + @JsonProperty("map_property") private Map mapProperty = null; - + @JsonProperty("map_of_map_property") private Map> mapOfMapProperty = null; - + public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; return this; } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { this.mapProperty = new HashMap(); } + this.mapProperty.put(key, mapPropertyItem); return this; } - - /** - * Get mapProperty - * @return mapProperty + /** + * Get mapProperty + * @return mapProperty **/ @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } - public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } - + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; return this; } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { this.mapOfMapProperty = new HashMap>(); } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } - - /** - * Get mapOfMapProperty - * @return mapOfMapProperty + /** + * Get mapOfMapProperty + * @return mapOfMapProperty **/ @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -104,8 +104,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapProperty, mapOfMapProperty); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -128,5 +127,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Animal.java index 590f36c0ae0..ddd1f98533f 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Animal.java @@ -25,56 +25,60 @@ /** * Animal */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true ) + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Discriminator{propertyName='className', mapping=null}", visible = true ) @JsonSubTypes({ + @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + }) public class Animal { + @JsonProperty("className") private String className = null; - + @JsonProperty("color") private String color = "red"; - + public Animal className(String className) { this.className = className; return this; } - /** - * Get className - * @return className + + /** + * Get className + * @return className **/ @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } - public void setClassName(String className) { this.className = className; } - + public Animal color(String color) { this.color = color; return this; } - /** - * Get color - * @return color + + /** + * Get color + * @return color **/ @ApiModelProperty(value = "") public String getColor() { return color; } - public void setColor(String color) { this.color = color; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -92,8 +96,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(className, color); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -116,5 +119,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/AnimalFarm.java deleted file mode 100644 index 0b1d6a74cc6..00000000000 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/AnimalFarm.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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 io.swagger.client.model.Animal; -import java.util.ArrayList; -import java.util.List; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index b7e59a030a4..380b98b1f70 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -28,36 +28,37 @@ */ public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") private List> arrayArrayNumber = null; - + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; return this; } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { this.arrayArrayNumber = new ArrayList>(); } + this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber **/ @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } - public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,8 +75,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayArrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -97,5 +97,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index fdfeb6856f3..482a3177a15 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -28,36 +28,37 @@ */ public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") private List arrayNumber = null; - + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; return this; } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { this.arrayNumber = new ArrayList(); } + this.arrayNumber.add(arrayNumberItem); return this; } - - /** - * Get arrayNumber - * @return arrayNumber + + /** + * Get arrayNumber + * @return arrayNumber **/ @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } - public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,8 +75,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -97,5 +97,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayTest.java index 62665c2536a..e70233c3c7f 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ArrayTest.java @@ -28,94 +28,97 @@ */ public class ArrayTest { + @JsonProperty("array_of_string") private List arrayOfString = null; - + @JsonProperty("array_array_of_integer") private List> arrayArrayOfInteger = null; - + @JsonProperty("array_array_of_model") private List> arrayArrayOfModel = null; - + public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; return this; } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { this.arrayOfString = new ArrayList(); } + this.arrayOfString.add(arrayOfStringItem); return this; } - - /** - * Get arrayOfString - * @return arrayOfString + + /** + * Get arrayOfString + * @return arrayOfString **/ @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } - public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } - + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { this.arrayArrayOfInteger = new ArrayList>(); } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger **/ @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } - + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { this.arrayArrayOfModel = new ArrayList>(); } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel **/ @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } - public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -134,8 +137,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -159,5 +161,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Capitalization.java index a72b0a72f46..f534657b4ca 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Capitalization.java @@ -25,133 +25,133 @@ */ public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel = null; - + @JsonProperty("CapitalCamel") private String capitalCamel = null; - + @JsonProperty("small_Snake") private String smallSnake = null; - + @JsonProperty("Capital_Snake") private String capitalSnake = null; - + @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints = null; - + @JsonProperty("ATT_NAME") private String ATT_NAME = null; - + public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; return this; } - /** - * Get smallCamel - * @return smallCamel + + /** + * Get smallCamel + * @return smallCamel **/ @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } - public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } - + public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; return this; } - /** - * Get capitalCamel - * @return capitalCamel + + /** + * Get capitalCamel + * @return capitalCamel **/ @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } - public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } - + public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; return this; } - /** - * Get smallSnake - * @return smallSnake + + /** + * Get smallSnake + * @return smallSnake **/ @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } - public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } - + public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; return this; } - /** - * Get capitalSnake - * @return capitalSnake + + /** + * Get capitalSnake + * @return capitalSnake **/ @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } - public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } - + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; return this; } - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints **/ @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } - public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } - + public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; return this; } - /** - * Name of the pet - * @return ATT_NAME + + /** + * Name of the pet + * @return ATT_NAME **/ @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } - public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -173,8 +173,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -201,5 +200,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Cat.java index b882da0ad90..d6e94912f06 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Cat.java @@ -26,28 +26,70 @@ */ public class Cat extends Animal { + + @JsonProperty("className") + private String className = null; + + @JsonProperty("color") + private String color = "red"; + @JsonProperty("declawed") private Boolean declawed = null; + + public Cat className(String className) { + this.className = className; + return this; + } + + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Cat color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; } - /** - * Get declawed - * @return declawed + + /** + * Get declawed + * @return declawed **/ @ApiModelProperty(value = "") public Boolean isDeclawed() { return declawed; } - public void setDeclawed(Boolean declawed) { this.declawed = declawed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -57,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && + return Objects.equals(this.className, cat.className) && + Objects.equals(this.color, cat.color) && + Objects.equals(this.declawed, cat.declawed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(declawed, super.hashCode()); + return Objects.hash(className, color, declawed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); sb.append("}"); return sb.toString(); @@ -88,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Category.java index 464f4375c4b..5ef89bf53cf 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Category.java @@ -25,49 +25,49 @@ */ public class Category { + @JsonProperty("id") private Long id = null; - + @JsonProperty("name") private String name = null; - + public Category id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Category name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -85,8 +85,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -109,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ClassModel.java index 4f764fde68d..887733b7310 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ClassModel.java @@ -22,32 +22,31 @@ /** * Model for testing model with \"_class\" property - */ -@ApiModel(description = "Model for testing model with \"_class\" property") + */@ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { + @JsonProperty("_class") private String propertyClass = null; - + public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,8 +63,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -87,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Client.java index a7c4253499c..6193700c6ca 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Client.java @@ -25,28 +25,28 @@ */ public class Client { + @JsonProperty("client") private String client = null; - + public Client client(String client) { this.client = client; return this; } - /** - * Get client - * @return client + + /** + * Get client + * @return client **/ @ApiModelProperty(value = "") public String getClient() { return client; } - public void setClient(String client) { this.client = client; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,8 +63,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(client); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -86,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Dog.java index 7de179b2ade..bffa0917362 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Dog.java @@ -26,28 +26,70 @@ */ public class Dog extends Animal { + + @JsonProperty("className") + private String className = null; + + @JsonProperty("color") + private String color = "red"; + @JsonProperty("breed") private String breed = null; + + public Dog className(String className) { + this.className = className; + return this; + } + + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Dog color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Dog breed(String breed) { this.breed = breed; return this; } - /** - * Get breed - * @return breed + + /** + * Get breed + * @return breed **/ @ApiModelProperty(value = "") public String getBreed() { return breed; } - public void setBreed(String breed) { this.breed = breed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -57,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && + return Objects.equals(this.className, dog.className) && + Objects.equals(this.color, dog.color) && + Objects.equals(this.breed, dog.breed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(breed, super.hashCode()); + return Objects.hash(className, color, breed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); sb.append("}"); return sb.toString(); @@ -88,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumArrays.java index 12caa480285..e23a220e753 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumArrays.java @@ -27,12 +27,13 @@ */ public class EnumArrays { - /** + + /** * Gets or Sets justSymbol */ public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), + GREATER_THAN_OR_EQUAL_TO(">="), DOLLAR("$"); private String value; @@ -40,8 +41,9 @@ public enum JustSymbolEnum { JustSymbolEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -50,8 +52,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static JustSymbolEnum fromValue(String text) { for (JustSymbolEnum b : JustSymbolEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -60,17 +63,20 @@ public static JustSymbolEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("just_symbol") private JustSymbolEnum justSymbol = null; - - /** + + + /** * Gets or Sets arrayEnum */ public enum ArrayEnumEnum { - FISH("fish"), + FISH("fish"), CRAB("crab"); private String value; @@ -78,8 +84,9 @@ public enum ArrayEnumEnum { ArrayEnumEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -88,8 +95,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static ArrayEnumEnum fromValue(String text) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -98,56 +106,57 @@ public static ArrayEnumEnum fromValue(String text) { } return null; } + } - + @JsonProperty("array_enum") private List arrayEnum = null; - + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; return this; } - /** - * Get justSymbol - * @return justSymbol + + /** + * Get justSymbol + * @return justSymbol **/ @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } - public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } - + public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; return this; } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { this.arrayEnum = new ArrayList(); } + this.arrayEnum.add(arrayEnumItem); return this; } - - /** - * Get arrayEnum - * @return arrayEnum + + /** + * Get arrayEnum + * @return arrayEnum **/ @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } - public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -165,8 +174,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -189,5 +197,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumClass.java index abbd7a56668..9414211ef6c 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumClass.java @@ -13,14 +13,17 @@ package io.swagger.client.model; -import java.util.Objects; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + + /** * Gets or Sets EnumClass */ + public enum EnumClass { _ABC("_abc"), @@ -35,7 +38,9 @@ public enum EnumClass { this.value = value; } + @JsonValue + public String getValue() { return value; } @@ -45,7 +50,9 @@ public String toString() { return String.valueOf(value); } + @JsonCreator + public static EnumClass fromValue(String text) { for (EnumClass b : EnumClass.values()) { if (String.valueOf(b.value).equals(text)) { @@ -54,5 +61,8 @@ public static EnumClass fromValue(String text) { } return null; } + } + + 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 93d0da037b6..4634e7018db 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 @@ -26,14 +26,14 @@ */ public class EnumTest { - /** + + /** * Gets or Sets enumString */ public enum EnumStringEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"), - EMPTY(""); private String value; @@ -41,8 +41,9 @@ public enum EnumStringEnum { EnumStringEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -51,8 +52,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumStringEnum fromValue(String text) { for (EnumStringEnum b : EnumStringEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -61,17 +63,19 @@ public static EnumStringEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_string") private EnumStringEnum enumString = null; - - /** + + /** * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(1), NUMBER_MINUS_1(-1); private Integer value; @@ -79,8 +83,9 @@ public enum EnumIntegerEnum { EnumIntegerEnum(Integer value) { this.value = value; } - + @JsonValue + public Integer getValue() { return value; } @@ -89,8 +94,9 @@ public Integer getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumIntegerEnum fromValue(String text) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -99,17 +105,19 @@ public static EnumIntegerEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger = null; - - /** + + /** * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(1.1), NUMBER_MINUS_1_DOT_2(-1.2); private Double value; @@ -117,8 +125,9 @@ public enum EnumNumberEnum { EnumNumberEnum(Double value) { this.value = value; } - + @JsonValue + public Double getValue() { return value; } @@ -127,8 +136,9 @@ public Double getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumNumberEnum fromValue(String text) { for (EnumNumberEnum b : EnumNumberEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -137,87 +147,88 @@ public static EnumNumberEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_number") private EnumNumberEnum enumNumber = null; - + @JsonProperty("outerEnum") private OuterEnum outerEnum = null; - + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; } - /** - * Get enumString - * @return enumString + + /** + * Get enumString + * @return enumString **/ @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } - public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } - + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; } - /** - * Get enumInteger - * @return enumInteger + + /** + * Get enumInteger + * @return enumInteger **/ @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } - public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } - + public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; return this; } - /** - * Get enumNumber - * @return enumNumber + + /** + * Get enumNumber + * @return enumNumber **/ @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } - public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - + public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; return this; } - /** - * Get outerEnum - * @return outerEnum + + /** + * Get outerEnum + * @return outerEnum **/ @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -237,8 +248,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -263,5 +273,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\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 4118656d29e..df02f3998d4 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 @@ -29,290 +29,284 @@ */ public class FormatTest { + @JsonProperty("integer") private Integer integer = null; - + @JsonProperty("int32") private Integer int32 = null; - + @JsonProperty("int64") private Long int64 = null; - + @JsonProperty("number") private BigDecimal number = null; - + @JsonProperty("float") private Float _float = null; - + @JsonProperty("double") private Double _double = null; - + @JsonProperty("string") private String string = null; - + @JsonProperty("byte") - private byte[] _byte = null; - + private String _byte = null; + @JsonProperty("binary") - private byte[] binary = null; - + private String binary = null; + @JsonProperty("date") private LocalDate date = null; - + @JsonProperty("dateTime") private OffsetDateTime dateTime = null; - + @JsonProperty("uuid") private UUID uuid = null; - + @JsonProperty("password") private String password = null; - + public FormatTest integer(Integer integer) { this.integer = integer; return this; } - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer **/ @ApiModelProperty(value = "") public Integer getInteger() { return integer; } - public void setInteger(Integer integer) { this.integer = integer; } - + public FormatTest int32(Integer int32) { this.int32 = int32; return this; } - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 **/ @ApiModelProperty(value = "") public Integer getInt32() { return int32; } - public void setInt32(Integer int32) { this.int32 = int32; } - + public FormatTest int64(Long int64) { this.int64 = int64; return this; } - /** - * Get int64 - * @return int64 + + /** + * Get int64 + * @return int64 **/ @ApiModelProperty(value = "") public Long getInt64() { return int64; } - public void setInt64(Long int64) { this.int64 = int64; } - + public FormatTest number(BigDecimal number) { this.number = number; return this; } - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number + + /** + * Get number + * @return number **/ @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } - public void setNumber(BigDecimal number) { this.number = number; } - + public FormatTest _float(Float _float) { this._float = _float; return this; } - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float + + /** + * Get _float + * @return _float **/ @ApiModelProperty(value = "") public Float getFloat() { return _float; } - public void setFloat(Float _float) { this._float = _float; } - + public FormatTest _double(Double _double) { this._double = _double; return this; } - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double + + /** + * Get _double + * @return _double **/ @ApiModelProperty(value = "") public Double getDouble() { return _double; } - public void setDouble(Double _double) { this._double = _double; } - + public FormatTest string(String string) { this.string = string; return this; } - /** - * Get string - * @return string + + /** + * Get string + * @return string **/ @ApiModelProperty(value = "") public String getString() { return string; } - public void setString(String string) { this.string = string; } - - public FormatTest _byte(byte[] _byte) { + + public FormatTest _byte(String _byte) { this._byte = _byte; return this; } - /** - * Get _byte - * @return _byte + + /** + * Get _byte + * @return _byte **/ @ApiModelProperty(required = true, value = "") - public byte[] getByte() { + public String getByte() { return _byte; } - - public void setByte(byte[] _byte) { + public void setByte(String _byte) { this._byte = _byte; } - - public FormatTest binary(byte[] binary) { + + public FormatTest binary(String binary) { this.binary = binary; return this; } - /** - * Get binary - * @return binary + + /** + * Get binary + * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public String getBinary() { return binary; } - - public void setBinary(byte[] binary) { + public void setBinary(String binary) { this.binary = binary; } - + public FormatTest date(LocalDate date) { this.date = date; return this; } - /** - * Get date - * @return date + + /** + * Get date + * @return date **/ @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } - public void setDate(LocalDate date) { this.date = date; } - + public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public FormatTest password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -341,8 +335,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -376,5 +369,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 6dc9f12c4b8..98a721fb9dc 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -25,31 +25,33 @@ */ public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar = null; - + @JsonProperty("foo") private String foo = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - - /** - * Get foo - * @return foo + + + /** + * Get foo + * @return foo **/ @ApiModelProperty(value = "") public String getFoo() { return foo; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,8 +69,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, foo); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -91,5 +92,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/MapTest.java index e6344a1df0f..90ed39f7e3f 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/MapTest.java @@ -28,15 +28,17 @@ */ public class MapTest { + @JsonProperty("map_map_of_string") private Map> mapMapOfString = null; - - /** + + + /** * Gets or Sets inner */ public enum InnerEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"); private String value; @@ -44,8 +46,9 @@ public enum InnerEnum { InnerEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -54,8 +57,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static InnerEnum fromValue(String text) { for (InnerEnum b : InnerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -64,64 +68,64 @@ public static InnerEnum fromValue(String text) { } return null; } + } - + @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; - + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { this.mapMapOfString = new HashMap>(); } + this.mapMapOfString.put(key, mapMapOfStringItem); return this; } - - /** - * Get mapMapOfString - * @return mapMapOfString + /** + * Get mapMapOfString + * @return mapMapOfString **/ @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } - public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } - + public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; return this; } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { this.mapOfEnumString = new HashMap(); } + this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } - - /** - * Get mapOfEnumString - * @return mapOfEnumString + /** + * Get mapOfEnumString + * @return mapOfEnumString **/ @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } - public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -139,8 +143,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -163,5 +166,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 29bfc7e8c08..4a8b69780fd 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -31,78 +31,78 @@ */ public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid = null; - + @JsonProperty("dateTime") private OffsetDateTime dateTime = null; - + @JsonProperty("map") private Map map = null; - + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; return this; } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { this.map = new HashMap(); } + this.map.put(key, mapItem); return this; } - - /** - * Get map - * @return map + /** + * Get map + * @return map **/ @ApiModelProperty(value = "") public Map getMap() { return map; } - public void setMap(Map map) { this.map = map; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -121,8 +121,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(uuid, dateTime, map); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -146,5 +145,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 58624475e43..606b051c2ea 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 @@ -22,53 +22,52 @@ /** * Model for testing model name starting with number - */ -@ApiModel(description = "Model for testing model name starting with number") + */@ApiModel(description = "Model for testing model name starting with number") public class Model200Response { + @JsonProperty("name") private Integer name = null; - + @JsonProperty("class") private String propertyClass = null; - + public Model200Response name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - + public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -86,8 +85,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -110,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelApiResponse.java index b010e53b48c..4002f3f632e 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -25,70 +25,70 @@ */ public class ModelApiResponse { + @JsonProperty("code") private Integer code = null; - + @JsonProperty("type") private String type = null; - + @JsonProperty("message") private String message = null; - + public ModelApiResponse code(Integer code) { this.code = code; return this; } - /** - * Get code - * @return code + + /** + * Get code + * @return code **/ @ApiModelProperty(value = "") public Integer getCode() { return code; } - public void setCode(Integer code) { this.code = code; } - + public ModelApiResponse type(String type) { this.type = type; return this; } - /** - * Get type - * @return type + + /** + * Get type + * @return type **/ @ApiModelProperty(value = "") public String getType() { return type; } - public void setType(String type) { this.type = type; } - + public ModelApiResponse message(String message) { this.message = message; return this; } - /** - * Get message - * @return message + + /** + * Get message + * @return message **/ @ApiModelProperty(value = "") public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -107,8 +107,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(code, type, message); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -132,5 +131,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelReturn.java index 27d08557248..685e5ba93ac 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelReturn.java @@ -22,32 +22,31 @@ /** * Model for testing reserved words - */ -@ApiModel(description = "Model for testing reserved words") + */@ApiModel(description = "Model for testing reserved words") public class ModelReturn { + @JsonProperty("return") private Integer _return = null; - + public ModelReturn _return(Integer _return) { this._return = _return; return this; } - /** - * Get _return - * @return _return + + /** + * Get _return + * @return _return **/ @ApiModelProperty(value = "") public Integer getReturn() { return _return; } - public void setReturn(Integer _return) { this._return = _return; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,8 +63,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(_return); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -87,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 f2b9b1703bd..7c94ab233c2 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 @@ -22,77 +22,78 @@ /** * Model for testing model name same as property name - */ -@ApiModel(description = "Model for testing model name same as property name") + */@ApiModel(description = "Model for testing model name same as property name") public class Name { + @JsonProperty("name") private Integer name = null; - + @JsonProperty("snake_case") private Integer snakeCase = null; - + @JsonProperty("property") private String property = null; - + @JsonProperty("123Number") private Integer _123Number = null; - + public Name name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - - /** - * Get snakeCase - * @return snakeCase + + + /** + * Get snakeCase + * @return snakeCase **/ @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } - + public Name property(String property) { this.property = property; return this; } - /** - * Get property - * @return property + + /** + * Get property + * @return property **/ @ApiModelProperty(value = "") public String getProperty() { return property; } - public void setProperty(String property) { this.property = property; } - - /** - * Get _123Number - * @return _123Number + + + /** + * Get _123Number + * @return _123Number **/ @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,8 +113,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, snakeCase, property, _123Number); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -138,5 +138,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/NumberOnly.java index ec93aba0531..dc53f9e50dc 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/NumberOnly.java @@ -26,28 +26,28 @@ */ public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber = null; - + public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; return this; } - /** - * Get justNumber - * @return justNumber + + /** + * Get justNumber + * @return justNumber **/ @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } - public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,8 +64,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -87,5 +86,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Order.java index 6976ceb8fba..0a6d7ad0933 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Order.java @@ -26,26 +26,26 @@ */ public class Order { + @JsonProperty("id") private Long id = null; - + @JsonProperty("petId") private Long petId = null; - + @JsonProperty("quantity") private Integer quantity = null; - + @JsonProperty("shipDate") private OffsetDateTime shipDate = null; - - /** + + /** * Order Status */ public enum StatusEnum { - PLACED("placed"), + PLACED("placed"), APPROVED("approved"), - DELIVERED("delivered"); private String value; @@ -53,8 +53,9 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -63,8 +64,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -73,123 +75,124 @@ public static StatusEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("status") private StatusEnum status = null; - + @JsonProperty("complete") private Boolean complete = false; - + public Order id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Order petId(Long petId) { this.petId = petId; return this; } - /** - * Get petId - * @return petId + + /** + * Get petId + * @return petId **/ @ApiModelProperty(value = "") public Long getPetId() { return petId; } - public void setPetId(Long petId) { this.petId = petId; } - + public Order quantity(Integer quantity) { this.quantity = quantity; return this; } - /** - * Get quantity - * @return quantity + + /** + * Get quantity + * @return quantity **/ @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } - public void setQuantity(Integer quantity) { this.quantity = quantity; } - + public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; return this; } - /** - * Get shipDate - * @return shipDate + + /** + * Get shipDate + * @return shipDate **/ @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } - public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } - + public Order status(StatusEnum status) { this.status = status; return this; } - /** - * Order Status - * @return status + + /** + * Order Status + * @return status **/ @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - + public Order complete(Boolean complete) { this.complete = complete; return this; } - /** - * Get complete - * @return complete + + /** + * Get complete + * @return complete **/ @ApiModelProperty(value = "") public Boolean isComplete() { return complete; } - public void setComplete(Boolean complete) { this.complete = complete; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -211,8 +214,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -239,5 +241,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterComposite.java index 02c16a99b70..8b957f45a14 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterComposite.java @@ -26,70 +26,70 @@ */ public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber = null; - + @JsonProperty("my_string") private String myString = null; - + @JsonProperty("my_boolean") private Boolean myBoolean = null; - + public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; return this; } - /** - * Get myNumber - * @return myNumber + + /** + * Get myNumber + * @return myNumber **/ @ApiModelProperty(value = "") public BigDecimal getMyNumber() { return myNumber; } - public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } - + public OuterComposite myString(String myString) { this.myString = myString; return this; } - /** - * Get myString - * @return myString + + /** + * Get myString + * @return myString **/ @ApiModelProperty(value = "") public String getMyString() { return myString; } - public void setMyString(String myString) { this.myString = myString; } - + public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; return this; } - /** - * Get myBoolean - * @return myBoolean + + /** + * Get myBoolean + * @return myBoolean **/ @ApiModelProperty(value = "") public Boolean getMyBoolean() { return myBoolean; } - public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -108,8 +108,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(myNumber, myString, myBoolean); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -133,5 +132,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterEnum.java index 948d80c2e6d..3390d473c7b 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterEnum.java @@ -13,14 +13,17 @@ package io.swagger.client.model; -import java.util.Objects; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + + /** * Gets or Sets OuterEnum */ + public enum OuterEnum { PLACED("placed"), @@ -35,7 +38,9 @@ public enum OuterEnum { this.value = value; } + @JsonValue + public String getValue() { return value; } @@ -45,7 +50,9 @@ public String toString() { return String.valueOf(value); } + @JsonCreator + public static OuterEnum fromValue(String text) { for (OuterEnum b : OuterEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -54,5 +61,8 @@ public static OuterEnum fromValue(String text) { } return null; } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Pet.java index 4c351dec3e4..ab51be3365d 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Pet.java @@ -29,29 +29,29 @@ */ public class Pet { + @JsonProperty("id") private Long id = null; - + @JsonProperty("category") private Category category = null; - + @JsonProperty("name") private String name = null; - + @JsonProperty("photoUrls") private List photoUrls = new ArrayList(); - + @JsonProperty("tags") private List tags = null; - - /** + + /** * pet status in the store */ public enum StatusEnum { - AVAILABLE("available"), + AVAILABLE("available"), PENDING("pending"), - SOLD("sold"); private String value; @@ -59,8 +59,9 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -69,8 +70,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -79,133 +81,135 @@ public static StatusEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("status") private StatusEnum status = null; - + public Pet id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Pet category(Category category) { this.category = category; return this; } - /** - * Get category - * @return category + + /** + * Get category + * @return category **/ @ApiModelProperty(value = "") public Category getCategory() { return category; } - public void setCategory(Category category) { this.category = category; } - + public Pet name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - + public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); return this; } - - /** - * Get photoUrls - * @return photoUrls + + /** + * Get photoUrls + * @return photoUrls **/ @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } - + public Pet tags(List tags) { this.tags = tags; return this; } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { this.tags = new ArrayList(); } + this.tags.add(tagsItem); return this; } - - /** - * Get tags - * @return tags + + /** + * Get tags + * @return tags **/ @ApiModelProperty(value = "") public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } - + public Pet status(StatusEnum status) { this.status = status; return this; } - /** - * pet status in the store - * @return status + + /** + * pet status in the store + * @return status **/ @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -227,8 +231,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -255,5 +258,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 76f8a912f36..1532a30b9e9 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -25,40 +25,41 @@ */ public class ReadOnlyFirst { + @JsonProperty("bar") private String bar = null; - + @JsonProperty("baz") private String baz = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; } - /** - * Get baz - * @return baz + + /** + * Get baz + * @return baz **/ @ApiModelProperty(value = "") public String getBaz() { return baz; } - public void setBaz(String baz) { this.baz = baz; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -76,8 +77,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, baz); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,5 +100,8 @@ private String toIndentedString(java.lang.Object o) { 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 784eb8baca8..38b54fd6c38 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 @@ -25,28 +25,28 @@ */ public class SpecialModelName { - @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + @JsonProperty("$special[property.name]") + private Long $specialPropertyName = null; + + 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; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -55,22 +55,21 @@ public boolean equals(java.lang.Object o) { 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); } - - + @Override public String toString() { 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(); } @@ -86,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Tag.java index 1cf2f5bc5e6..2967322b174 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Tag.java @@ -25,49 +25,49 @@ */ public class Tag { + @JsonProperty("id") private Long id = null; - + @JsonProperty("name") private String name = null; - + public Tag id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Tag name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -85,8 +85,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -109,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/User.java index de5bc439c5a..cb2f9f34084 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/User.java @@ -25,175 +25,175 @@ */ public class User { + @JsonProperty("id") private Long id = null; - + @JsonProperty("username") private String username = null; - + @JsonProperty("firstName") private String firstName = null; - + @JsonProperty("lastName") private String lastName = null; - + @JsonProperty("email") private String email = null; - + @JsonProperty("password") private String password = null; - + @JsonProperty("phone") private String phone = null; - + @JsonProperty("userStatus") private Integer userStatus = null; - + public User id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public User username(String username) { this.username = username; return this; } - /** - * Get username - * @return username + + /** + * Get username + * @return username **/ @ApiModelProperty(value = "") public String getUsername() { return username; } - public void setUsername(String username) { this.username = username; } - + public User firstName(String firstName) { this.firstName = firstName; return this; } - /** - * Get firstName - * @return firstName + + /** + * Get firstName + * @return firstName **/ @ApiModelProperty(value = "") public String getFirstName() { return firstName; } - public void setFirstName(String firstName) { this.firstName = firstName; } - + public User lastName(String lastName) { this.lastName = lastName; return this; } - /** - * Get lastName - * @return lastName + + /** + * Get lastName + * @return lastName **/ @ApiModelProperty(value = "") public String getLastName() { return lastName; } - public void setLastName(String lastName) { this.lastName = lastName; } - + public User email(String email) { this.email = email; return this; } - /** - * Get email - * @return email + + /** + * Get email + * @return email **/ @ApiModelProperty(value = "") public String getEmail() { return email; } - public void setEmail(String email) { this.email = email; } - + public User password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - + public User phone(String phone) { this.phone = phone; return this; } - /** - * Get phone - * @return phone + + /** + * Get phone + * @return phone **/ @ApiModelProperty(value = "") public String getPhone() { return phone; } - public void setPhone(String phone) { this.phone = phone; } - + public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; } - /** - * User Status - * @return userStatus + + /** + * User Status + * @return userStatus **/ @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } - public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -217,8 +217,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -247,5 +246,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..6fdbe0d606c 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 @@ -14,14 +14,17 @@ package io.swagger.client.api; import io.swagger.client.model.Client; + 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 AnotherFakeApi */ @@ -41,8 +44,10 @@ 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..ffbadbfc5f5 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,17 +15,18 @@ 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 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 FakeApi */ @@ -45,7 +46,9 @@ public class FakeApiTest { */ @Test public void fakeOuterBooleanSerializeTest() { + Boolean body = null; + Boolean response = api.fakeOuterBooleanSerialize(body); // TODO: test validations @@ -61,8 +64,10 @@ public void fakeOuterBooleanSerializeTest() { */ @Test public void fakeOuterCompositeSerializeTest() { - OuterComposite body = null; - OuterComposite response = api.fakeOuterCompositeSerialize(body); + + OuterComposite outercomposite = null; + + OuterComposite response = api.fakeOuterCompositeSerialize(outercomposite); // TODO: test validations } @@ -77,7 +82,9 @@ public void fakeOuterCompositeSerializeTest() { */ @Test public void fakeOuterNumberSerializeTest() { + BigDecimal body = null; + BigDecimal response = api.fakeOuterNumberSerialize(body); // TODO: test validations @@ -93,7 +100,9 @@ public void fakeOuterNumberSerializeTest() { */ @Test public void fakeOuterStringSerializeTest() { + String body = null; + String response = api.fakeOuterStringSerialize(body); // TODO: test validations @@ -109,8 +118,10 @@ public void fakeOuterStringSerializeTest() { */ @Test public void testClientModelTest() { - Client body = null; - Client response = api.testClientModel(body); + + Client client = null; + + Client response = api.testClientModel(client); // TODO: test validations } @@ -125,21 +136,10 @@ public void testClientModelTest() { */ @Test public void testEndpointParametersTest() { - BigDecimal number = null; - Double _double = null; - String patternWithoutDelimiter = null; - byte[] _byte = null; - Integer integer = null; - Integer int32 = null; - Long int64 = null; - Float _float = null; - String string = null; - byte[] binary = null; - LocalDate date = null; - OffsetDateTime dateTime = null; - String password = null; - String paramCallback = null; - api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + + Object body = null; + + api.testEndpointParameters(body); // TODO: test validations } @@ -154,15 +154,38 @@ public void testEndpointParametersTest() { */ @Test public void testEnumParametersTest() { - List enumFormStringArray = null; - String enumFormString = null; + + Object body = 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); + + api.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); + + // TODO: test validations + } + + /** + * test inline additionalProperties + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testInlineAdditionalPropertiesTest() { + + Map body = null; + + api.testInlineAdditionalProperties(body); // TODO: test validations } @@ -177,9 +200,10 @@ public void testEnumParametersTest() { */ @Test public void testJsonFormDataTest() { - String param = null; - String param2 = null; - api.testJsonFormData(param, param2); + + Object body = null; + + api.testJsonFormData(body); // 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..8c2f3365902 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 @@ -14,14 +14,17 @@ package io.swagger.client.api; import io.swagger.client.model.Client; + 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 FakeClassnameTags123Api */ @@ -41,8 +44,10 @@ public class FakeClassnameTags123ApiTest { */ @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..21ff6da020f 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,188 @@ +/* + * 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.client.model.ModelApiResponse; +import io.swagger.client.model.Pet; -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; -import io.swagger.TestUtils; +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.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; 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); - - 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()); + public void deletePetTest() { + + Integer 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 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); - 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 } - + + /** + * Find pet by ID + * + * Returns a single pet + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testFindPetsByStatus() throws Exception { - Pet pet = createRandomPet(); - pet.setName("programmer"); - pet.setStatus(Pet.StatusEnum.AVAILABLE); - - api.updatePet(pet); + public void getPetByIdTest() { + + Integer petId = null; + + Pet response = api.getPetById(petId); - 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); -// } - + + /** + * Update an existing pet + * + * + * + * @throws ApiException + * if the Api call fails + */ @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()); + public void updatePetTest() { + + Pet pet = null; + + api.updatePet(pet); - assertEquals(updated.getName(), "furt"); + // TODO: test validations } - + + /** + * Updates a pet in the store with form data + * + * + * + * @throws ApiException + * if the Api call fails + */ @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()); - } + public void updatePetWithFormTest() { + + Integer petId = null; + + Object body = null; + + api.updatePetWithForm(petId, body); + + // TODO: test validations } - + + /** + * uploads an image + * + * + * + * @throws ApiException + * if the Api call fails + */ @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; + public void uploadFileTest() { + + Integer petId = null; + + Object body = null; + + ModelApiResponse response = api.uploadFile(petId, body); + + // 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..4b7a616eba0 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,107 @@ -package io.swagger.client.api; +/* + * 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. + */ -import io.swagger.TestUtils; -import io.swagger.client.*; -import io.swagger.client.api.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; +package io.swagger.client.api; -import java.lang.reflect.Field; -import java.util.Map; -import java.text.SimpleDateFormat; +import io.swagger.client.model.Order; -import org.junit.*; -import org.springframework.web.client.RestClientException; -import org.threeten.bp.OffsetDateTime; +import org.junit.Test; +import org.junit.Ignore; -import static org.junit.Assert.*; -public class StoreApiTest { - StoreApi api = null; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; - @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")); - } - @Test - public void testGetInventory() throws Exception { - Map inventory = api.getInventory(); - assertTrue(inventory.keySet().size() > 0); - } +/** + * 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 testGetInventoryInObject() throws Exception { - Object inventoryObj = api.getInventoryInObject(); - assertTrue(inventoryObj instanceof Map); + public void deleteOrderTest() { + + String orderId = null; + + api.deleteOrder(orderId); - 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 } - */ - + + /** + * Returns pet inventories by status + * + * Returns a map of status codes to quantities + * + * @throws ApiException + * if the Api call fails + */ @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 + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testDeleteOrder() throws Exception { - Order order = createOrder(); - api.placeOrder(order); - - Order fetched = api.getOrderById(order.getId()); - assertEquals(fetched.getId(), order.getId()); + public void getOrderByIdTest() { + + Integer orderId = null; + + Order response = api.getOrderById(orderId); - api.deleteOrder(String.valueOf(order.getId())); - - try { - api.getOrderById(order.getId()); - // fail("expected an error"); - } catch (RestClientException e) { - // ok - } + // TODO: test validations } + + /** + * Place an order for a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @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(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..c3d9b85c156 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,183 @@ +/* + * 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 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 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()); - - api.createUsersWithArrayInput(Arrays.asList(new User[]{user1, user2})); + public void createUsersWithArrayInputTest() { + + List body = null; + + api.createUsersWithArrayInput(body); - 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()); - - api.createUsersWithListInput(Arrays.asList(new User[]{user1, user2})); + public void createUsersWithListInputTest() { + + List body = null; + + api.createUsersWithListInput(body); - 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 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 logoutUser() throws Exception { - api.logoutUser(); + 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() { + + User user = null; + + String username = null; + + api.updateUser(user, username); + + // 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/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/client/petstore/java/retrofit/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/retrofit/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit/README.md b/samples/client/petstore/java/retrofit/README.md index 93488cf4e5c..424ab81784e 100644 --- a/samples/client/petstore/java/retrofit/README.md +++ b/samples/client/petstore/java/retrofit/README.md @@ -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..917dfba320e 100644 --- a/samples/client/petstore/java/retrofit/build.gradle +++ b/samples/client/petstore/java/retrofit/build.gradle @@ -32,8 +32,11 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { + + sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 + } // Rename the aar correctly @@ -95,7 +98,7 @@ if(hasProperty('target') && target == 'android') { ext { okhttp_version = "2.7.5" - oltu_version = "1.0.1" + oltu_version = "1.0.2" retrofit_version = "1.9.0" swagger_annotations_version = "1.5.8" junit_version = "4.12" diff --git a/samples/client/petstore/java/retrofit/build.sbt b/samples/client/petstore/java/retrofit/build.sbt index 629c85c2bf3..490ce5a72e2 100644 --- a/samples/client/petstore/java/retrofit/build.sbt +++ b/samples/client/petstore/java/retrofit/build.sbt @@ -12,7 +12,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp" % "okhttp" % "2.7.5" % "compile", "com.squareup.retrofit" % "retrofit" % "1.9.0" % "compile", "io.swagger" % "swagger-annotations" % "1.5.8" % "compile", - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2" % "compile", "joda-time" % "joda-time" % "2.9.3" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" 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/AnimalFarm.md b/samples/client/petstore/java/retrofit/docs/AnimalFarm.md deleted file mode 100644 index c7c7f1ddcce..00000000000 --- a/samples/client/petstore/java/retrofit/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ - -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - 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/ModelReturn.md b/samples/client/petstore/java/retrofit/docs/ModelReturn.md deleted file mode 100644 index a679b04953e..00000000000 --- a/samples/client/petstore/java/retrofit/docs/ModelReturn.md +++ /dev/null @@ -1,10 +0,0 @@ - -# ModelReturn - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **Integer** | | [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/git_push.sh b/samples/client/petstore/java/retrofit/git_push.sh index ae01b182ae9..ed374619b13 100644 --- a/samples/client/petstore/java/retrofit/git_push.sh +++ b/samples/client/petstore/java/retrofit/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 credential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential 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/retrofit/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/retrofit/gradle/wrapper/gradle-wrapper.jar index 2c6137b8789..e69de29bb2d 100644 Binary files a/samples/client/petstore/java/retrofit/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/retrofit/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/retrofit/pom.xml b/samples/client/petstore/java/retrofit/pom.xml index 5b122647ef1..680adf316b9 100644 --- a/samples/client/petstore/java/retrofit/pom.xml +++ b/samples/client/petstore/java/retrofit/pom.xml @@ -1,244 +1,225 @@ - 4.0.0 - io.swagger - swagger-petstore-retrofit - jar - swagger-petstore-retrofit - 1.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-petstore-retrofit + jar + swagger-petstore-retrofit + 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 - 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 + - - - 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 - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - 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-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.2 - - - - jar - test-jar - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - org.codehaus.mojo - build-helper-maven-plugin - - - 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.7 - 1.7 - - - - 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 - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + + + 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.7 + 1.7 + + + + 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 - - - - - - - - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + - - - io.swagger - swagger-annotations - ${swagger-core-version} - - - com.squareup.retrofit - retrofit - ${retrofit-version} - - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - ${oltu-version} - - - com.squareup.okhttp - okhttp - ${okhttp-version} - - - joda-time - joda-time - ${jodatime-version} - + + + io.swagger + swagger-annotations + ${swagger-core-version} + + + com.squareup.retrofit + retrofit + ${retrofit-version} + + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + ${oltu-version} + + + com.squareup.okhttp + okhttp + ${okhttp-version} + + + joda-time + joda-time + ${jodatime-version} + + - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.5.15 - 1.9.0 - 2.7.5 - 2.9.9 - 1.0.1 - 1.0.0 - 4.12 - + + + junit + junit + ${junit-version} + test + + + + 1.5.15 + 1.9.0 + 2.7.5 + 2.9.9 + 1.0.2 + 1.0.0 + 4.12 + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/ApiClient.java index 19ed094161f..61796d8c794 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/ApiClient.java @@ -53,21 +53,36 @@ public ApiClient() { public ApiClient(String[] authNames) { this(); for(String authName : authNames) { + Interceptor auth; if ("api_key".equals(authName)) { + + auth = new ApiKeyAuth("header", "api_key"); + } else if ("api_key_query".equals(authName)) { + + auth = new ApiKeyAuth("query", "api_key_query"); + } else if ("http_basic_test".equals(authName)) { + auth = new HttpBasicAuth(); - + + + } else if ("petstore_auth".equals(authName)) { - - auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); + + + + auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", ""); + } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } addAuthorization(authName, auth); + + } } 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..264dd43b497 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 @@ -8,34 +8,49 @@ import io.swagger.client.model.Client; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + 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..67530a1f527 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 @@ -8,22 +8,30 @@ import java.math.BigDecimal; import io.swagger.client.model.Client; -import org.joda.time.DateTime; -import org.joda.time.LocalDate; import io.swagger.client.model.OuterComposite; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public interface FakeApi { + /** * * Sync method * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + + * @return Boolean + + */ @POST("/fake/outer/boolean") @@ -34,44 +42,62 @@ Boolean fakeOuterBooleanSerialize( /** * * Async method + * @param body Input boolean as post body (optional) + * @param cb callback method + */ @POST("/fake/outer/boolean") void fakeOuterBooleanSerialize( @retrofit.http.Body Boolean body, 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 ); + /** * * Sync method * Test serialization of outer number types + * @param body Input number as post body (optional) + + * @return BigDecimal + + */ @POST("/fake/outer/number") @@ -82,20 +108,29 @@ BigDecimal fakeOuterNumberSerialize( /** * * Async method + * @param body Input number as post body (optional) + * @param cb callback method + */ @POST("/fake/outer/number") void fakeOuterNumberSerialize( @retrofit.http.Body BigDecimal body, Callback cb ); + /** * * Sync method * Test serialization of outer string types + * @param body Input string as post body (optional) + + * @return String + + */ @POST("/fake/outer/string") @@ -106,180 +141,202 @@ String fakeOuterStringSerialize( /** * * Async method + * @param body Input string as post body (optional) + * @param cb callback method + */ @POST("/fake/outer/string") void fakeOuterStringSerialize( @retrofit.http.Body String body, 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 假端點 偽のエンドポイント 가짜 엔드 포인트 * Sync method * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) + + * @param body (required) + + * @return Void + + */ - @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.Body Object body ); /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Async method - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) + + * @param body (required) + * @param cb callback method + */ - @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.Body Object body, 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 body (optional) + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + + * @param enumHeaderString Header parameter enum test (string) (optional) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + + * @param enumQueryString Query parameter enum test (string) (optional) + * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (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.Body Object body, @retrofit.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit.http.Header("enum_header_string") String enumHeaderString, @retrofit.http.Query("enum_query_string_array") List enumQueryStringArray, @retrofit.http.Query("enum_query_string") String enumQueryString, @retrofit.http.Query("enum_query_integer") Integer enumQueryInteger ); /** * 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 body (optional) + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + + * @param enumHeaderString Header parameter enum test (string) (optional) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + + * @param enumQueryString Query parameter enum test (string) (optional) + * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (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.Body Object body, @retrofit.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit.http.Header("enum_header_string") String enumHeaderString, @retrofit.http.Query("enum_query_string_array") List enumQueryStringArray, @retrofit.http.Query("enum_query_string") String enumQueryString, @retrofit.http.Query("enum_query_integer") Integer enumQueryInteger, Callback cb ); + /** * test inline additionalProperties * Sync method * - * @param param request body (required) + + * @param body request body (required) + + * @return Void + + */ @POST("/fake/inline-additionalProperties") Void testInlineAdditionalProperties( - @retrofit.http.Body Object param + @retrofit.http.Body Map body ); /** * test inline additionalProperties * Async method - * @param param request body (required) + + * @param body request body (required) + * @param cb callback method + */ @POST("/fake/inline-additionalProperties") void testInlineAdditionalProperties( - @retrofit.http.Body Object param, Callback cb + @retrofit.http.Body Map body, Callback cb ); + /** * test json serialization of form data * Sync method * - * @param param field1 (required) - * @param param2 field2 (required) + + * @param body (required) + + * @return Void + + */ - @retrofit.http.FormUrlEncoded @GET("/fake/jsonFormData") Void testJsonFormData( - @retrofit.http.Field("param") String param, @retrofit.http.Field("param2") String param2 + @retrofit.http.Body Object body ); /** * test json serialization of form data * Async method - * @param param field1 (required) - * @param param2 field2 (required) + + * @param body (required) + * @param cb callback method + */ - @retrofit.http.FormUrlEncoded @GET("/fake/jsonFormData") void testJsonFormData( - @retrofit.http.Field("param") String param, @retrofit.http.Field("param2") String param2, Callback cb + @retrofit.http.Body Object body, Callback cb ); + } + 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 0b7cd1bc1e1..6952b75cc5c 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 @@ -8,34 +8,49 @@ import io.swagger.client.model.Client; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public interface FakeClassnameTags123Api { + /** * To test class name in snake case * Sync method * - * @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..5909000e080 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 @@ -6,220 +6,295 @@ import retrofit.http.*; import retrofit.mime.*; -import java.io.File; import io.swagger.client.model.ModelApiResponse; import io.swagger.client.model.Pet; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + 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 * Sync method * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + + * @return Void + + */ @DELETE("/pet/{petId}") Void deletePet( - @retrofit.http.Path("petId") Long petId, @retrofit.http.Header("api_key") String apiKey + @retrofit.http.Path("petId") Integer petId, @retrofit.http.Header("api_key") String apiKey ); /** * Deletes a pet * Async method + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @param cb callback method + */ @DELETE("/pet/{petId}") void deletePet( - @retrofit.http.Path("petId") Long petId, @retrofit.http.Header("api_key") String apiKey, Callback cb + @retrofit.http.Path("petId") Integer petId, @retrofit.http.Header("api_key") String apiKey, Callback cb ); + /** * Finds Pets by status * Sync method * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + + * @return List<Pet> + + */ @GET("/pet/findByStatus") List findPetsByStatus( - @retrofit.http.Query("status") CSVParams status + @retrofit.http.Query("status") List status ); /** * Finds Pets by status * Async method + * @param status Status values that need to be considered for filter (required) + * @param cb callback method + */ @GET("/pet/findByStatus") void findPetsByStatus( - @retrofit.http.Query("status") CSVParams status, Callback> cb + @retrofit.http.Query("status") List status, Callback> cb ); + /** * Finds Pets by tags * Sync method * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + + * @return List<Pet> + + */ @GET("/pet/findByTags") List findPetsByTags( - @retrofit.http.Query("tags") CSVParams tags + @retrofit.http.Query("tags") List tags ); /** * Finds Pets by tags * Async method + * @param tags Tags to filter by (required) + * @param cb callback method + */ @GET("/pet/findByTags") void findPetsByTags( - @retrofit.http.Query("tags") CSVParams tags, Callback> cb + @retrofit.http.Query("tags") List tags, Callback> cb ); + /** * Find pet by ID * Sync method * Returns a single pet + * @param petId ID of pet to return (required) + + * @return Pet + + */ @GET("/pet/{petId}") Pet getPetById( - @retrofit.http.Path("petId") Long petId + @retrofit.http.Path("petId") Integer petId ); /** * Find pet by ID * Async method + * @param petId ID of pet to return (required) + * @param cb callback method + */ @GET("/pet/{petId}") void getPetById( - @retrofit.http.Path("petId") Long petId, Callback cb + @retrofit.http.Path("petId") Integer petId, Callback cb ); + /** * 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 * Sync method * + * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) + + * @param body (optional) + + * @return Void + + */ - @retrofit.http.FormUrlEncoded @POST("/pet/{petId}") Void updatePetWithForm( - @retrofit.http.Path("petId") Long petId, @retrofit.http.Field("name") String name, @retrofit.http.Field("status") String status + @retrofit.http.Path("petId") Integer petId, @retrofit.http.Body Object body ); /** * Updates a pet in the store with form data * Async method + * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) + + * @param body (optional) + * @param cb callback method + */ - @retrofit.http.FormUrlEncoded @POST("/pet/{petId}") void updatePetWithForm( - @retrofit.http.Path("petId") Long petId, @retrofit.http.Field("name") String name, @retrofit.http.Field("status") String status, Callback cb + @retrofit.http.Path("petId") Integer petId, @retrofit.http.Body Object body, Callback cb ); + /** * uploads an image * Sync method * + * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) + + * @param body (optional) + + * @return ModelApiResponse + + */ - @retrofit.http.Multipart @POST("/pet/{petId}/uploadImage") ModelApiResponse uploadFile( - @retrofit.http.Path("petId") Long petId, @retrofit.http.Part("additionalMetadata") String additionalMetadata, @retrofit.http.Part("file") TypedFile file + @retrofit.http.Path("petId") Integer petId, @retrofit.http.Body Object body ); /** * uploads an image * Async method + * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) + + * @param body (optional) + * @param cb callback method + */ - @retrofit.http.Multipart @POST("/pet/{petId}/uploadImage") void uploadFile( - @retrofit.http.Path("petId") Long petId, @retrofit.http.Part("additionalMetadata") String additionalMetadata, @retrofit.http.Part("file") TypedFile file, Callback cb + @retrofit.http.Path("petId") Integer petId, @retrofit.http.Body Object body, Callback cb ); + } + 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..0a4755201c4 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 @@ -8,18 +8,28 @@ import io.swagger.client.model.Order; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public interface StoreApi { + /** * Delete purchase order by ID * Sync method * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + + * @return Void + + */ @DELETE("/store/order/{order_id}") @@ -30,19 +40,27 @@ Void deleteOrder( /** * Delete purchase order by ID * Async method + * @param orderId ID of the order that needs to be deleted (required) + * @param cb callback method + */ @DELETE("/store/order/{order_id}") void deleteOrder( @retrofit.http.Path("order_id") String orderId, Callback cb ); + /** * Returns pet inventories by status * Sync method * Returns a map of status codes to quantities + + * @return Map<String, Integer> + + */ @GET("/store/inventory") @@ -52,59 +70,81 @@ void deleteOrder( /** * Returns pet inventories by status * Async method + * @param cb callback method + */ @GET("/store/inventory") void getInventory( Callback> cb ); + /** * Find purchase order by ID * Sync method * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + + * @return Order + + */ @GET("/store/order/{order_id}") Order getOrderById( - @retrofit.http.Path("order_id") Long orderId + @retrofit.http.Path("order_id") Integer orderId ); /** * Find purchase order by ID * Async method + * @param orderId ID of pet that needs to be fetched (required) + * @param cb callback method + */ @GET("/store/order/{order_id}") void getOrderById( - @retrofit.http.Path("order_id") Long orderId, Callback cb + @retrofit.http.Path("order_id") Integer orderId, Callback cb ); + /** * 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 4eb592928f8..f76dbcd1c75 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 @@ -8,42 +8,61 @@ import io.swagger.client.model.User; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + 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) + + * @return Void + + */ @POST("/user/createWithArray") @@ -54,20 +73,29 @@ Void createUsersWithArrayInput( /** * Creates list of users with given input array * Async method + * @param body List of user object (required) + * @param cb callback method + */ @POST("/user/createWithArray") void createUsersWithArrayInput( @retrofit.http.Body List body, Callback cb ); + /** * Creates list of users with given input array * Sync method * + * @param body List of user object (required) + + * @return Void + + */ @POST("/user/createWithList") @@ -78,20 +106,29 @@ Void createUsersWithListInput( /** * Creates list of users with given input array * Async method + * @param body List of user object (required) + * @param cb callback method + */ @POST("/user/createWithList") void createUsersWithListInput( @retrofit.http.Body List body, Callback cb ); + /** * Delete user * Sync method * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + + * @return Void + + */ @DELETE("/user/{username}") @@ -102,20 +139,29 @@ Void deleteUser( /** * Delete user * Async method + * @param username The name that needs to be deleted (required) + * @param cb callback method + */ @DELETE("/user/{username}") void deleteUser( @retrofit.http.Path("username") String username, Callback cb ); + /** * Get user by user name * Sync method * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + + * @return User + + */ @GET("/user/{username}") @@ -126,21 +172,31 @@ User getUserByName( /** * Get user by user name * Async method + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param cb callback method + */ @GET("/user/{username}") void getUserByName( @retrofit.http.Path("username") String username, Callback cb ); + /** * Logs user into the system * Sync method * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + + * @return String + + */ @GET("/user/login") @@ -151,20 +207,29 @@ String loginUser( /** * Logs user into the system * Async method + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @param cb callback method + */ @GET("/user/login") void loginUser( @retrofit.http.Query("username") String username, @retrofit.http.Query("password") String password, Callback cb ); + /** * Logs out current logged in user session * Sync method * + + * @return Void + + */ @GET("/user/logout") @@ -174,37 +239,52 @@ void loginUser( /** * Logs out current logged in user session * Async method + * @param cb callback method + */ @GET("/user/logout") void logoutUser( Callback cb ); + /** * Updated user * Sync method * This can only be done by the logged in user. + + * @param user Updated user object (required) + * @param username name that need to be deleted (required) - * @param body Updated user object (required) + + * @return Void + + */ @PUT("/user/{username}") Void updateUser( - @retrofit.http.Path("username") String username, @retrofit.http.Body User body + @retrofit.http.Body User user, @retrofit.http.Path("username") String username ); /** * Updated user * Async method + + * @param user Updated user object (required) + * @param username name that need to be deleted (required) - * @param body 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.Body User user, @retrofit.http.Path("username") String username, Callback cb ); + } + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/auth/OAuthOkHttpClient.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/auth/OAuthOkHttpClient.java index c872901ba24..b7f4312db03 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/auth/OAuthOkHttpClient.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/auth/OAuthOkHttpClient.java @@ -56,6 +56,7 @@ public T execute(OAuthClientRequest request, Map response.body().string(), response.body().contentType().toString(), response.code(), + response.headers().toMultimap(), responseClass); } catch (IOException e) { throw new OAuthSystemException(e); diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index b302fdf6012..56510d9ad3c 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -31,65 +31,63 @@ */ public class AdditionalPropertiesClass { - @SerializedName("map_property") +@SerializedName("map_property") private Map mapProperty = null; - @SerializedName("map_of_map_property") private Map> mapOfMapProperty = null; - + public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; return this; } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { this.mapProperty = new HashMap(); } + this.mapProperty.put(key, mapPropertyItem); return this; } - - /** - * Get mapProperty - * @return mapProperty + /** + * Get mapProperty + * @return mapProperty **/ @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } - public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } - + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; return this; } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { this.mapOfMapProperty = new HashMap>(); } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } - - /** - * Get mapOfMapProperty - * @return mapOfMapProperty + /** + * Get mapOfMapProperty + * @return mapOfMapProperty **/ @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -107,8 +105,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapProperty, mapOfMapProperty); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -131,5 +128,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Animal.java index f65c5bffcb3..7d0184c4016 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Animal.java @@ -29,49 +29,47 @@ public class Animal { - @SerializedName("className") +@SerializedName("className") private String className = null; - @SerializedName("color") private String color = "red"; - + public Animal className(String className) { this.className = className; return this; } - /** - * Get className - * @return className + + /** + * Get className + * @return className **/ @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } - public void setClassName(String className) { this.className = className; } - + public Animal color(String color) { this.color = color; return this; } - /** - * Get color - * @return color + + /** + * Get color + * @return color **/ @ApiModelProperty(value = "") public String getColor() { return color; } - public void setColor(String color) { this.color = color; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -89,8 +87,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(className, color); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -113,5 +110,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AnimalFarm.java deleted file mode 100644 index 0b1d6a74cc6..00000000000 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/AnimalFarm.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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 io.swagger.client.model.Animal; -import java.util.ArrayList; -import java.util.List; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index f9956fe46d8..6072a884b8b 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -31,36 +31,36 @@ */ public class ArrayOfArrayOfNumberOnly { - @SerializedName("ArrayArrayNumber") +@SerializedName("ArrayArrayNumber") private List> arrayArrayNumber = null; - + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; return this; } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { this.arrayArrayNumber = new ArrayList>(); } + this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber **/ @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } - public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -77,8 +77,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayArrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,5 +99,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index c79610d1c66..9d03a82a520 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -31,36 +31,36 @@ */ public class ArrayOfNumberOnly { - @SerializedName("ArrayNumber") +@SerializedName("ArrayNumber") private List arrayNumber = null; - + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; return this; } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { this.arrayNumber = new ArrayList(); } + this.arrayNumber.add(arrayNumberItem); return this; } - - /** - * Get arrayNumber - * @return arrayNumber + + /** + * Get arrayNumber + * @return arrayNumber **/ @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } - public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -77,8 +77,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,5 +99,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayTest.java index 747182e792e..16a6ebcc6f0 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ArrayTest.java @@ -31,94 +31,94 @@ */ public class ArrayTest { - @SerializedName("array_of_string") +@SerializedName("array_of_string") private List arrayOfString = null; - @SerializedName("array_array_of_integer") private List> arrayArrayOfInteger = null; - @SerializedName("array_array_of_model") private List> arrayArrayOfModel = null; - + public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; return this; } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { this.arrayOfString = new ArrayList(); } + this.arrayOfString.add(arrayOfStringItem); return this; } - - /** - * Get arrayOfString - * @return arrayOfString + + /** + * Get arrayOfString + * @return arrayOfString **/ @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } - public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } - + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { this.arrayArrayOfInteger = new ArrayList>(); } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger **/ @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } - + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { this.arrayArrayOfModel = new ArrayList>(); } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel **/ @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } - public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -137,8 +137,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -162,5 +161,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Capitalization.java index 00c564ab727..2c7727d7261 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Capitalization.java @@ -28,133 +28,127 @@ */ public class Capitalization { - @SerializedName("smallCamel") +@SerializedName("smallCamel") private String smallCamel = null; - @SerializedName("CapitalCamel") private String capitalCamel = null; - @SerializedName("small_Snake") private String smallSnake = null; - @SerializedName("Capital_Snake") private String capitalSnake = null; - @SerializedName("SCA_ETH_Flow_Points") private String scAETHFlowPoints = null; - @SerializedName("ATT_NAME") private String ATT_NAME = null; - + public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; return this; } - /** - * Get smallCamel - * @return smallCamel + + /** + * Get smallCamel + * @return smallCamel **/ @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } - public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } - + public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; return this; } - /** - * Get capitalCamel - * @return capitalCamel + + /** + * Get capitalCamel + * @return capitalCamel **/ @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } - public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } - + public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; return this; } - /** - * Get smallSnake - * @return smallSnake + + /** + * Get smallSnake + * @return smallSnake **/ @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } - public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } - + public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; return this; } - /** - * Get capitalSnake - * @return capitalSnake + + /** + * Get capitalSnake + * @return capitalSnake **/ @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } - public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } - + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; return this; } - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints **/ @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } - public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } - + public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; return this; } - /** - * Name of the pet - * @return ATT_NAME + + /** + * Name of the pet + * @return ATT_NAME **/ @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } - public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -176,8 +170,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -204,5 +197,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Cat.java index 64d3fbdc7fe..b093e138ba6 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Cat.java @@ -29,28 +29,67 @@ */ public class Cat extends Animal { +@SerializedName("className") + private String className = null; + @SerializedName("color") + private String color = "red"; @SerializedName("declawed") private Boolean declawed = null; + + public Cat className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Cat color(String color) { + this.color = color; + return this; + } + + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; } - /** - * Get declawed - * @return declawed + + /** + * Get declawed + * @return declawed **/ @ApiModelProperty(value = "") public Boolean isDeclawed() { return declawed; } - public void setDeclawed(Boolean declawed) { this.declawed = declawed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -60,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && + return Objects.equals(this.className, cat.className) && + Objects.equals(this.color, cat.color) && + Objects.equals(this.declawed, cat.declawed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(declawed, super.hashCode()); + return Objects.hash(className, color, declawed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); sb.append("}"); return sb.toString(); @@ -91,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Category.java index 4e9f8f56e5e..42e198faaff 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Category.java @@ -28,49 +28,47 @@ */ public class Category { - @SerializedName("id") +@SerializedName("id") private Long id = null; - @SerializedName("name") private String name = null; - + public Category id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Category name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -88,8 +86,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -112,5 +109,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ClassModel.java index 4cf0a053250..627c102a69a 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ClassModel.java @@ -25,32 +25,30 @@ /** * Model for testing model with \"_class\" property - */ -@ApiModel(description = "Model for testing model with \"_class\" property") + */@ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @SerializedName("_class") +@SerializedName("_class") private String propertyClass = null; - + public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,8 +65,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -90,5 +87,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Client.java index 43b20dce8da..460c9e52ba1 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Client.java @@ -28,28 +28,27 @@ */ public class Client { - @SerializedName("client") +@SerializedName("client") private String client = null; - + public Client client(String client) { this.client = client; return this; } - /** - * Get client - * @return client + + /** + * Get client + * @return client **/ @ApiModelProperty(value = "") public String getClient() { return client; } - public void setClient(String client) { this.client = client; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -66,8 +65,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(client); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,5 +87,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Dog.java index 8fad06d9835..4d52b28512f 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Dog.java @@ -29,28 +29,67 @@ */ public class Dog extends Animal { +@SerializedName("className") + private String className = null; + @SerializedName("color") + private String color = "red"; @SerializedName("breed") private String breed = null; + + public Dog className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Dog color(String color) { + this.color = color; + return this; + } + + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Dog breed(String breed) { this.breed = breed; return this; } - /** - * Get breed - * @return breed + + /** + * Get breed + * @return breed **/ @ApiModelProperty(value = "") public String getBreed() { return breed; } - public void setBreed(String breed) { this.breed = breed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -60,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && + return Objects.equals(this.className, dog.className) && + Objects.equals(this.color, dog.color) && + Objects.equals(this.breed, dog.breed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(breed, super.hashCode()); + return Objects.hash(className, color, breed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); sb.append("}"); return sb.toString(); @@ -91,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumArrays.java index 5f063c2ec38..43000487324 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumArrays.java @@ -30,13 +30,14 @@ */ public class EnumArrays { - /** + + /** * Gets or Sets justSymbol */ @JsonAdapter(JustSymbolEnum.Adapter.class) public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), + GREATER_THAN_OR_EQUAL_TO(">="), DOLLAR("$"); private String value; @@ -44,7 +45,7 @@ public enum JustSymbolEnum { JustSymbolEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -53,7 +54,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static JustSymbolEnum fromValue(String text) { for (JustSymbolEnum b : JustSymbolEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -62,7 +63,7 @@ public static JustSymbolEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final JustSymbolEnum enumeration) throws IOException { @@ -76,17 +77,18 @@ public JustSymbolEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("just_symbol") private JustSymbolEnum justSymbol = null; - - /** + + + /** * Gets or Sets arrayEnum */ @JsonAdapter(ArrayEnumEnum.Adapter.class) public enum ArrayEnumEnum { - FISH("fish"), + FISH("fish"), CRAB("crab"); private String value; @@ -94,7 +96,7 @@ public enum ArrayEnumEnum { ArrayEnumEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -103,7 +105,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static ArrayEnumEnum fromValue(String text) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -112,7 +114,7 @@ public static ArrayEnumEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final ArrayEnumEnum enumeration) throws IOException { @@ -126,55 +128,54 @@ public ArrayEnumEnum read(final JsonReader jsonReader) throws IOException { } } } - @SerializedName("array_enum") private List arrayEnum = null; - + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; return this; } - /** - * Get justSymbol - * @return justSymbol + + /** + * Get justSymbol + * @return justSymbol **/ @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } - public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } - + public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; return this; } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { this.arrayEnum = new ArrayList(); } + this.arrayEnum.add(arrayEnumItem); return this; } - - /** - * Get arrayEnum - * @return arrayEnum + + /** + * Get arrayEnum + * @return arrayEnum **/ @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } - public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -192,8 +193,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -216,5 +216,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumClass.java index 3c19333c1ce..80a5d20a545 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumClass.java @@ -16,16 +16,21 @@ import java.util.Objects; import com.google.gson.annotations.SerializedName; + + import java.io.IOException; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; + /** * Gets or Sets EnumClass */ + @JsonAdapter(EnumClass.Adapter.class) + public enum EnumClass { _ABC("_abc"), @@ -40,6 +45,7 @@ public enum EnumClass { this.value = value; } + public String getValue() { return value; } @@ -49,6 +55,7 @@ public String toString() { return String.valueOf(value); } + public static EnumClass fromValue(String text) { for (EnumClass b : EnumClass.values()) { if (String.valueOf(b.value).equals(text)) { @@ -58,6 +65,7 @@ public static EnumClass fromValue(String text) { return null; } + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final EnumClass enumeration) throws IOException { @@ -70,5 +78,8 @@ public EnumClass read(final JsonReader jsonReader) throws IOException { return EnumClass.fromValue(String.valueOf(value)); } } + } + + 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 fb20599a85c..4ca2772ab1b 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 @@ -29,15 +29,15 @@ */ public class EnumTest { - /** + + /** * Gets or Sets enumString */ @JsonAdapter(EnumStringEnum.Adapter.class) public enum EnumStringEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"), - EMPTY(""); private String value; @@ -45,7 +45,7 @@ public enum EnumStringEnum { EnumStringEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -54,7 +54,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static EnumStringEnum fromValue(String text) { for (EnumStringEnum b : EnumStringEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -63,7 +63,7 @@ public static EnumStringEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final EnumStringEnum enumeration) throws IOException { @@ -77,17 +77,17 @@ public EnumStringEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("enum_string") private EnumStringEnum enumString = null; - - /** + + /** * Gets or Sets enumInteger */ @JsonAdapter(EnumIntegerEnum.Adapter.class) public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(1), NUMBER_MINUS_1(-1); private Integer value; @@ -95,7 +95,7 @@ public enum EnumIntegerEnum { EnumIntegerEnum(Integer value) { this.value = value; } - + public Integer getValue() { return value; } @@ -104,7 +104,7 @@ public Integer getValue() { public String toString() { return String.valueOf(value); } - + public static EnumIntegerEnum fromValue(String text) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -113,7 +113,7 @@ public static EnumIntegerEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final EnumIntegerEnum enumeration) throws IOException { @@ -127,17 +127,17 @@ public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("enum_integer") private EnumIntegerEnum enumInteger = null; - - /** + + /** * Gets or Sets enumNumber */ @JsonAdapter(EnumNumberEnum.Adapter.class) public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(1.1), NUMBER_MINUS_1_DOT_2(-1.2); private Double value; @@ -145,7 +145,7 @@ public enum EnumNumberEnum { EnumNumberEnum(Double value) { this.value = value; } - + public Double getValue() { return value; } @@ -154,7 +154,7 @@ public Double getValue() { public String toString() { return String.valueOf(value); } - + public static EnumNumberEnum fromValue(String text) { for (EnumNumberEnum b : EnumNumberEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -163,7 +163,7 @@ public static EnumNumberEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final EnumNumberEnum enumeration) throws IOException { @@ -177,86 +177,84 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("enum_number") private EnumNumberEnum enumNumber = null; - @SerializedName("outerEnum") private OuterEnum outerEnum = null; - + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; } - /** - * Get enumString - * @return enumString + + /** + * Get enumString + * @return enumString **/ @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } - public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } - + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; } - /** - * Get enumInteger - * @return enumInteger + + /** + * Get enumInteger + * @return enumInteger **/ @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } - public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } - + public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; return this; } - /** - * Get enumNumber - * @return enumNumber + + /** + * Get enumNumber + * @return enumNumber **/ @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } - public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - + public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; return this; } - /** - * Get outerEnum - * @return outerEnum + + /** + * Get outerEnum + * @return outerEnum **/ @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -276,8 +274,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -302,5 +299,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\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 5c0f01dd86b..26bf692b8ee 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 @@ -32,290 +32,271 @@ */ public class FormatTest { - @SerializedName("integer") +@SerializedName("integer") private Integer integer = null; - @SerializedName("int32") private Integer int32 = null; - @SerializedName("int64") private Long int64 = null; - @SerializedName("number") private BigDecimal number = null; - @SerializedName("float") private Float _float = null; - @SerializedName("double") private Double _double = null; - @SerializedName("string") private String string = null; - @SerializedName("byte") - private byte[] _byte = null; - + private String _byte = null; @SerializedName("binary") - private byte[] binary = null; - + private String binary = null; @SerializedName("date") private LocalDate date = null; - @SerializedName("dateTime") private DateTime dateTime = null; - @SerializedName("uuid") private UUID uuid = null; - @SerializedName("password") private String password = null; - + public FormatTest integer(Integer integer) { this.integer = integer; return this; } - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer **/ @ApiModelProperty(value = "") public Integer getInteger() { return integer; } - public void setInteger(Integer integer) { this.integer = integer; } - + public FormatTest int32(Integer int32) { this.int32 = int32; return this; } - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 **/ @ApiModelProperty(value = "") public Integer getInt32() { return int32; } - public void setInt32(Integer int32) { this.int32 = int32; } - + public FormatTest int64(Long int64) { this.int64 = int64; return this; } - /** - * Get int64 - * @return int64 + + /** + * Get int64 + * @return int64 **/ @ApiModelProperty(value = "") public Long getInt64() { return int64; } - public void setInt64(Long int64) { this.int64 = int64; } - + public FormatTest number(BigDecimal number) { this.number = number; return this; } - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number + + /** + * Get number + * @return number **/ @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } - public void setNumber(BigDecimal number) { this.number = number; } - + public FormatTest _float(Float _float) { this._float = _float; return this; } - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float + + /** + * Get _float + * @return _float **/ @ApiModelProperty(value = "") public Float getFloat() { return _float; } - public void setFloat(Float _float) { this._float = _float; } - + public FormatTest _double(Double _double) { this._double = _double; return this; } - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double + + /** + * Get _double + * @return _double **/ @ApiModelProperty(value = "") public Double getDouble() { return _double; } - public void setDouble(Double _double) { this._double = _double; } - + public FormatTest string(String string) { this.string = string; return this; } - /** - * Get string - * @return string + + /** + * Get string + * @return string **/ @ApiModelProperty(value = "") public String getString() { return string; } - public void setString(String string) { this.string = string; } - - public FormatTest _byte(byte[] _byte) { + + public FormatTest _byte(String _byte) { this._byte = _byte; return this; } - /** - * Get _byte - * @return _byte + + /** + * Get _byte + * @return _byte **/ @ApiModelProperty(required = true, value = "") - public byte[] getByte() { + public String getByte() { return _byte; } - - public void setByte(byte[] _byte) { + public void setByte(String _byte) { this._byte = _byte; } - - public FormatTest binary(byte[] binary) { + + public FormatTest binary(String binary) { this.binary = binary; return this; } - /** - * Get binary - * @return binary + + /** + * Get binary + * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public String getBinary() { return binary; } - - public void setBinary(byte[] binary) { + public void setBinary(String binary) { this.binary = binary; } - + public FormatTest date(LocalDate date) { this.date = date; return this; } - /** - * Get date - * @return date + + /** + * Get date + * @return date **/ @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } - public void setDate(LocalDate date) { this.date = date; } - + public FormatTest dateTime(DateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } - public void setDateTime(DateTime dateTime) { this.dateTime = dateTime; } - + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public FormatTest password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -344,8 +325,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -379,5 +359,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 1b7ff181941..ddb6837fecb 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -28,31 +28,31 @@ */ public class HasOnlyReadOnly { - @SerializedName("bar") +@SerializedName("bar") private String bar = null; - @SerializedName("foo") private String foo = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - - /** - * Get foo - * @return foo + + + /** + * Get foo + * @return foo **/ @ApiModelProperty(value = "") public String getFoo() { return foo; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,8 +70,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, foo); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -94,5 +93,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MapTest.java index a791e68d8fb..29e18228896 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MapTest.java @@ -31,16 +31,17 @@ */ public class MapTest { - @SerializedName("map_map_of_string") +@SerializedName("map_map_of_string") private Map> mapMapOfString = null; - - /** + + + /** * Gets or Sets inner */ @JsonAdapter(InnerEnum.Adapter.class) public enum InnerEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"); private String value; @@ -48,7 +49,7 @@ public enum InnerEnum { InnerEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -57,7 +58,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static InnerEnum fromValue(String text) { for (InnerEnum b : InnerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -66,7 +67,7 @@ public static InnerEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final InnerEnum enumeration) throws IOException { @@ -80,63 +81,61 @@ public InnerEnum read(final JsonReader jsonReader) throws IOException { } } } - @SerializedName("map_of_enum_string") private Map mapOfEnumString = null; - + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { this.mapMapOfString = new HashMap>(); } + this.mapMapOfString.put(key, mapMapOfStringItem); return this; } - - /** - * Get mapMapOfString - * @return mapMapOfString + /** + * Get mapMapOfString + * @return mapMapOfString **/ @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } - public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } - + public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; return this; } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { this.mapOfEnumString = new HashMap(); } + this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } - - /** - * Get mapOfEnumString - * @return mapOfEnumString + /** + * Get mapOfEnumString + * @return mapOfEnumString **/ @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } - public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,8 +153,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -178,5 +176,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index d023144f768..01ef3a8d929 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -34,78 +34,75 @@ */ public class MixedPropertiesAndAdditionalPropertiesClass { - @SerializedName("uuid") +@SerializedName("uuid") private UUID uuid = null; - @SerializedName("dateTime") private DateTime dateTime = null; - @SerializedName("map") private Map map = null; - + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public MixedPropertiesAndAdditionalPropertiesClass dateTime(DateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public DateTime getDateTime() { return dateTime; } - public void setDateTime(DateTime dateTime) { this.dateTime = dateTime; } - + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; return this; } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { this.map = new HashMap(); } + this.map.put(key, mapItem); return this; } - - /** - * Get map - * @return map + /** + * Get map + * @return map **/ @ApiModelProperty(value = "") public Map getMap() { return map; } - public void setMap(Map map) { this.map = map; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -124,8 +121,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(uuid, dateTime, map); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -149,5 +145,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 0d39eb7eff5..66416f6c0cb 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 @@ -25,53 +25,50 @@ /** * Model for testing model name starting with number - */ -@ApiModel(description = "Model for testing model name starting with number") + */@ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @SerializedName("name") +@SerializedName("name") private Integer name = null; - @SerializedName("class") private String propertyClass = null; - + public Model200Response name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - + public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -89,8 +86,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -113,5 +109,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelApiResponse.java index 3d9352c50aa..5217ac1d2ea 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -28,70 +28,67 @@ */ public class ModelApiResponse { - @SerializedName("code") +@SerializedName("code") private Integer code = null; - @SerializedName("type") private String type = null; - @SerializedName("message") private String message = null; - + public ModelApiResponse code(Integer code) { this.code = code; return this; } - /** - * Get code - * @return code + + /** + * Get code + * @return code **/ @ApiModelProperty(value = "") public Integer getCode() { return code; } - public void setCode(Integer code) { this.code = code; } - + public ModelApiResponse type(String type) { this.type = type; return this; } - /** - * Get type - * @return type + + /** + * Get type + * @return type **/ @ApiModelProperty(value = "") public String getType() { return type; } - public void setType(String type) { this.type = type; } - + public ModelApiResponse message(String message) { this.message = message; return this; } - /** - * Get message - * @return message + + /** + * Get message + * @return message **/ @ApiModelProperty(value = "") public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,8 +107,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(code, type, message); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -135,5 +131,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelReturn.java index ab6333ff86d..21d717b8076 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelReturn.java @@ -25,32 +25,30 @@ /** * Model for testing reserved words - */ -@ApiModel(description = "Model for testing reserved words") + */@ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @SerializedName("return") +@SerializedName("return") private Integer _return = null; - + public ModelReturn _return(Integer _return) { this._return = _return; return this; } - /** - * Get _return - * @return _return + + /** + * Get _return + * @return _return **/ @ApiModelProperty(value = "") public Integer getReturn() { return _return; } - public void setReturn(Integer _return) { this._return = _return; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,8 +65,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(_return); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -90,5 +87,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 1492add2952..c631e933a60 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 @@ -25,77 +25,74 @@ /** * Model for testing model name same as property name - */ -@ApiModel(description = "Model for testing model name same as property name") + */@ApiModel(description = "Model for testing model name same as property name") public class Name { - @SerializedName("name") +@SerializedName("name") private Integer name = null; - @SerializedName("snake_case") private Integer snakeCase = null; - @SerializedName("property") private String property = null; - @SerializedName("123Number") private Integer _123Number = null; - + public Name name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - - /** - * Get snakeCase - * @return snakeCase + + + /** + * Get snakeCase + * @return snakeCase **/ @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } - + public Name property(String property) { this.property = property; return this; } - /** - * Get property - * @return property + + /** + * Get property + * @return property **/ @ApiModelProperty(value = "") public String getProperty() { return property; } - public void setProperty(String property) { this.property = property; } - - /** - * Get _123Number - * @return _123Number + + + /** + * Get _123Number + * @return _123Number **/ @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -115,8 +112,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, snakeCase, property, _123Number); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -141,5 +137,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/NumberOnly.java index b13c0536a13..0468fa26f78 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/NumberOnly.java @@ -29,28 +29,27 @@ */ public class NumberOnly { - @SerializedName("JustNumber") +@SerializedName("JustNumber") private BigDecimal justNumber = null; - + public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; return this; } - /** - * Get justNumber - * @return justNumber + + /** + * Get justNumber + * @return justNumber **/ @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } - public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,8 +66,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -90,5 +88,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java index bea33fc7fb3..ff0a9f5ddf6 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Order.java @@ -29,27 +29,23 @@ */ public class Order { - @SerializedName("id") +@SerializedName("id") private Long id = null; - @SerializedName("petId") private Long petId = null; - @SerializedName("quantity") private Integer quantity = null; - @SerializedName("shipDate") private DateTime shipDate = null; - - /** + + /** * Order Status */ @JsonAdapter(StatusEnum.Adapter.class) public enum StatusEnum { - PLACED("placed"), + PLACED("placed"), APPROVED("approved"), - DELIVERED("delivered"); private String value; @@ -57,7 +53,7 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -66,7 +62,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -75,7 +71,7 @@ public static StatusEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { @@ -89,122 +85,120 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("status") private StatusEnum status = null; - @SerializedName("complete") private Boolean complete = false; - + public Order id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Order petId(Long petId) { this.petId = petId; return this; } - /** - * Get petId - * @return petId + + /** + * Get petId + * @return petId **/ @ApiModelProperty(value = "") public Long getPetId() { return petId; } - public void setPetId(Long petId) { this.petId = petId; } - + public Order quantity(Integer quantity) { this.quantity = quantity; return this; } - /** - * Get quantity - * @return quantity + + /** + * Get quantity + * @return quantity **/ @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } - public void setQuantity(Integer quantity) { this.quantity = quantity; } - + public Order shipDate(DateTime shipDate) { this.shipDate = shipDate; return this; } - /** - * Get shipDate - * @return shipDate + + /** + * Get shipDate + * @return shipDate **/ @ApiModelProperty(value = "") public DateTime getShipDate() { return shipDate; } - public void setShipDate(DateTime shipDate) { this.shipDate = shipDate; } - + public Order status(StatusEnum status) { this.status = status; return this; } - /** - * Order Status - * @return status + + /** + * Order Status + * @return status **/ @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - + public Order complete(Boolean complete) { this.complete = complete; return this; } - /** - * Get complete - * @return complete + + /** + * Get complete + * @return complete **/ @ApiModelProperty(value = "") public Boolean isComplete() { return complete; } - public void setComplete(Boolean complete) { this.complete = complete; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -226,8 +220,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -254,5 +247,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterComposite.java index 56159fe5d93..039a870d41b 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterComposite.java @@ -29,70 +29,67 @@ */ public class OuterComposite { - @SerializedName("my_number") +@SerializedName("my_number") private BigDecimal myNumber = null; - @SerializedName("my_string") private String myString = null; - @SerializedName("my_boolean") private Boolean myBoolean = null; - + public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; return this; } - /** - * Get myNumber - * @return myNumber + + /** + * Get myNumber + * @return myNumber **/ @ApiModelProperty(value = "") public BigDecimal getMyNumber() { return myNumber; } - public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } - + public OuterComposite myString(String myString) { this.myString = myString; return this; } - /** - * Get myString - * @return myString + + /** + * Get myString + * @return myString **/ @ApiModelProperty(value = "") public String getMyString() { return myString; } - public void setMyString(String myString) { this.myString = myString; } - + public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; return this; } - /** - * Get myBoolean - * @return myBoolean + + /** + * Get myBoolean + * @return myBoolean **/ @ApiModelProperty(value = "") public Boolean getMyBoolean() { return myBoolean; } - public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -111,8 +108,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(myNumber, myString, myBoolean); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -136,5 +132,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterEnum.java index 3b24acc6b51..2bb0d8fcb27 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/OuterEnum.java @@ -16,16 +16,21 @@ import java.util.Objects; import com.google.gson.annotations.SerializedName; + + import java.io.IOException; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; + /** * Gets or Sets OuterEnum */ + @JsonAdapter(OuterEnum.Adapter.class) + public enum OuterEnum { PLACED("placed"), @@ -40,6 +45,7 @@ public enum OuterEnum { this.value = value; } + public String getValue() { return value; } @@ -49,6 +55,7 @@ public String toString() { return String.valueOf(value); } + public static OuterEnum fromValue(String text) { for (OuterEnum b : OuterEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -58,6 +65,7 @@ public static OuterEnum fromValue(String text) { return null; } + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final OuterEnum enumeration) throws IOException { @@ -70,5 +78,8 @@ public OuterEnum read(final JsonReader jsonReader) throws IOException { return OuterEnum.fromValue(String.valueOf(value)); } } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java index dac1250ac07..2b91dae9614 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Pet.java @@ -32,30 +32,25 @@ */ public class Pet { - @SerializedName("id") +@SerializedName("id") private Long id = null; - @SerializedName("category") private Category category = null; - @SerializedName("name") private String name = null; - @SerializedName("photoUrls") private List photoUrls = new ArrayList(); - @SerializedName("tags") private List tags = null; - - /** + + /** * pet status in the store */ @JsonAdapter(StatusEnum.Adapter.class) public enum StatusEnum { - AVAILABLE("available"), + AVAILABLE("available"), PENDING("pending"), - SOLD("sold"); private String value; @@ -63,7 +58,7 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -72,7 +67,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -81,7 +76,7 @@ public static StatusEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { @@ -95,132 +90,132 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("status") private StatusEnum status = null; - + public Pet id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Pet category(Category category) { this.category = category; return this; } - /** - * Get category - * @return category + + /** + * Get category + * @return category **/ @ApiModelProperty(value = "") public Category getCategory() { return category; } - public void setCategory(Category category) { this.category = category; } - + public Pet name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - + public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); return this; } - - /** - * Get photoUrls - * @return photoUrls + + /** + * Get photoUrls + * @return photoUrls **/ @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } - + public Pet tags(List tags) { this.tags = tags; return this; } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { this.tags = new ArrayList(); } + this.tags.add(tagsItem); return this; } - - /** - * Get tags - * @return tags + + /** + * Get tags + * @return tags **/ @ApiModelProperty(value = "") public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } - + public Pet status(StatusEnum status) { this.status = status; return this; } - /** - * pet status in the store - * @return status + + /** + * pet status in the store + * @return status **/ @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -242,8 +237,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -270,5 +264,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index f6e025412de..c7c8eb90968 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -28,40 +28,39 @@ */ public class ReadOnlyFirst { - @SerializedName("bar") +@SerializedName("bar") private String bar = null; - @SerializedName("baz") private String baz = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; } - /** - * Get baz - * @return baz + + /** + * Get baz + * @return baz **/ @ApiModelProperty(value = "") public String getBaz() { return baz; } - public void setBaz(String baz) { this.baz = baz; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -79,8 +78,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, baz); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -103,5 +101,8 @@ private String toIndentedString(java.lang.Object o) { 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 e743292100b..3e2312615c2 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 @@ -28,28 +28,27 @@ */ public class SpecialModelName { - @SerializedName("$special[property.name]") - private Long specialPropertyName = null; - - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; +@SerializedName("$special[property.name]") + private Long $specialPropertyName = null; + + 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; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,22 +57,21 @@ public boolean equals(java.lang.Object o) { 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); } - - + @Override public String toString() { 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(); } @@ -89,5 +87,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Tag.java index bb6de58c8a1..b032d15676a 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Tag.java @@ -28,49 +28,47 @@ */ public class Tag { - @SerializedName("id") +@SerializedName("id") private Long id = null; - @SerializedName("name") private String name = null; - + public Tag id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Tag name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -88,8 +86,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -112,5 +109,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/User.java index 4ccb8a1c147..75e44e2ff37 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/User.java @@ -28,175 +28,167 @@ */ public class User { - @SerializedName("id") +@SerializedName("id") private Long id = null; - @SerializedName("username") private String username = null; - @SerializedName("firstName") private String firstName = null; - @SerializedName("lastName") private String lastName = null; - @SerializedName("email") private String email = null; - @SerializedName("password") private String password = null; - @SerializedName("phone") private String phone = null; - @SerializedName("userStatus") private Integer userStatus = null; - + public User id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public User username(String username) { this.username = username; return this; } - /** - * Get username - * @return username + + /** + * Get username + * @return username **/ @ApiModelProperty(value = "") public String getUsername() { return username; } - public void setUsername(String username) { this.username = username; } - + public User firstName(String firstName) { this.firstName = firstName; return this; } - /** - * Get firstName - * @return firstName + + /** + * Get firstName + * @return firstName **/ @ApiModelProperty(value = "") public String getFirstName() { return firstName; } - public void setFirstName(String firstName) { this.firstName = firstName; } - + public User lastName(String lastName) { this.lastName = lastName; return this; } - /** - * Get lastName - * @return lastName + + /** + * Get lastName + * @return lastName **/ @ApiModelProperty(value = "") public String getLastName() { return lastName; } - public void setLastName(String lastName) { this.lastName = lastName; } - + public User email(String email) { this.email = email; return this; } - /** - * Get email - * @return email + + /** + * Get email + * @return email **/ @ApiModelProperty(value = "") public String getEmail() { return email; } - public void setEmail(String email) { this.email = email; } - + public User password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - + public User phone(String phone) { this.phone = phone; return this; } - /** - * Get phone - * @return phone + + /** + * Get phone + * @return phone **/ @ApiModelProperty(value = "") public String getPhone() { return phone; } - public void setPhone(String phone) { this.phone = phone; } - + public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; } - /** - * User Status - * @return userStatus + + /** + * User Status + * @return userStatus **/ @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } - public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -220,8 +212,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -250,5 +241,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..cb1bd34536f 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 @@ -2,14 +2,17 @@ import io.swagger.client.ApiClient; import io.swagger.client.model.Client; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for AnotherFakeApi */ @@ -30,8 +33,10 @@ public void setup() { */ @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..0547de7fdc4 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,15 +2,19 @@ import io.swagger.client.ApiClient; import java.math.BigDecimal; -import java.util.Date; +import io.swagger.client.model.Client; +import io.swagger.client.model.OuterComposite; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for FakeApi */ @@ -24,6 +28,81 @@ public void setup() { } + /** + * + * + * Test serialization of outer boolean types + */ + @Test + public void fakeOuterBooleanSerializeTest() { + + Boolean body = null; + + // Boolean response = api.fakeOuterBooleanSerialize(body); + + // 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 + } + + /** + * 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 假端點 偽のエンドポイント 가짜 엔드 포인트 * @@ -31,19 +110,65 @@ public void setup() { */ @Test public void testEndpointParametersTest() { - BigDecimal number = null; - Double _double = null; - String string = 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 password = null; - // Void response = api.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); + + Object body = null; + + // Void response = api.testEndpointParameters(body); + + // TODO: test validations + } + + /** + * To test enum parameters + * + * To test enum parameters + */ + @Test + public void testEnumParametersTest() { + + Object body = null; + + List enumHeaderStringArray = null; + + String enumHeaderString = null; + + List enumQueryStringArray = null; + + String enumQueryString = null; + + Integer enumQueryInteger = null; + + // Void response = api.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); + + // TODO: test validations + } + + /** + * test inline additionalProperties + * + * + */ + @Test + public void testInlineAdditionalPropertiesTest() { + + Map body = null; + + // Void response = api.testInlineAdditionalProperties(body); + + // TODO: test validations + } + + /** + * test json serialization of form data + * + * + */ + @Test + public void testJsonFormDataTest() { + + Object body = null; + + // Void response = api.testJsonFormData(body); // 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..37316254648 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 @@ -2,14 +2,17 @@ import io.swagger.client.ApiClient; import io.swagger.client.model.Client; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for FakeClassnameTags123Api */ @@ -30,8 +33,10 @@ public void setup() { */ @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..b028c35eccf 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,156 @@ package io.swagger.client.api; -import io.swagger.TestUtils; +import io.swagger.client.ApiClient; +import io.swagger.client.model.ModelApiResponse; +import io.swagger.client.model.Pet; -import io.swagger.client.*; -import io.swagger.client.CollectionFormats.*; -import io.swagger.client.model.*; +import org.junit.Before; +import org.junit.Test; -import retrofit.RetrofitError; -import retrofit.mime.TypedFile; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; 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); - - Pet fetched = api.getPetById(pet.getId()); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); - } - - @Test - public void testUpdatePet() throws Exception { - Pet pet = createRandomPet(); - pet.setName("programmer"); + public void addPetTest() { + + Pet pet = null; + + // Void response = api.addPet(pet); - 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 } - + + /** + * Deletes a pet + * + * + */ @Test - public void testFindPetsByStatus() throws Exception { - Pet pet = createRandomPet(); - pet.setName("programmer"); - pet.setStatus(Pet.StatusEnum.AVAILABLE); - - 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); + public void deletePetTest() { + + Integer petId = null; + + String apiKey = null; + + // Void response = api.deletePet(petId, apiKey); + + // TODO: test validations } - + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + */ @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(new CSVParams("friendly")); - 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 testUpdatePetWithForm() throws Exception { - Pet pet = createRandomPet(); - pet.setName("frank"); - api.addPet(pet); + public void findPetsByTagsTest() { + + List tags = null; + + // List response = api.findPetsByTags(tags); - 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 } - + + /** + * Find pet by ID + * + * Returns a single pet + */ @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 (RetrofitError e) { - assertEquals(404, e.getResponse().getStatus()); - } - } + public void getPetByIdTest() { + + Integer petId = null; + + // Pet response = api.getPetById(petId); + // TODO: test validations + } + + /** + * Update an existing pet + * + * + */ @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(); + public void updatePetTest() { + + Pet pet = null; + + // Void response = api.updatePet(pet); - api.uploadFile(pet.getId(), "a test file", new TypedFile("text/plain", file)); + // TODO: test validations } - + + /** + * Updates a pet in the store with form data + * + * + */ @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()); + public void updatePetWithFormTest() { + + Integer petId = null; + + Object body = null; + + // Void response = api.updatePetWithForm(petId, body); + + // TODO: test validations } - - 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; + + /** + * uploads an image + * + * + */ + @Test + public void uploadFileTest() { + + Integer petId = null; + + Object body = null; + + // ModelApiResponse response = api.uploadFile(petId, body); + + // 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..f40e0a2a4db 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,87 @@ 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; + + // Void response = 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() { + + Integer 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..495c733e5ff 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,151 @@ 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 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 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(); - - api.createUser(user); + public void createUserTest() { + + User user = null; + + // Void response = 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()); - - api.createUsersWithArrayInput(Arrays.asList(new User[]{user1, user2})); + public void createUsersWithArrayInputTest() { + + List body = null; + + // Void response = api.createUsersWithArrayInput(body); - 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 body = null; + + // Void response = api.createUsersWithListInput(body); - 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; + + // Void response = 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 logoutUser() throws Exception { - api.logoutUser(); + 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() { + + // Void response = 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. + */ + @Test + public void updateUserTest() { + + User user = null; + + String username = null; + + // Void response = api.updateUser(user, username); + + // TODO: test validations } + } diff --git a/samples/client/petstore/java/retrofit2-play24/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit2-play24/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/client/petstore/java/retrofit2-play24/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/retrofit2-play24/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-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-play24/build.gradle b/samples/client/petstore/java/retrofit2-play24/build.gradle index 5ba5dc34efc..755142abbac 100644 --- a/samples/client/petstore/java/retrofit2-play24/build.gradle +++ b/samples/client/petstore/java/retrofit2-play24/build.gradle @@ -32,8 +32,11 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 + + } // Rename the aar correctly @@ -94,12 +97,21 @@ if(hasProperty('target') && target == 'android') { } ext { - oltu_version = "1.0.1" + oltu_version = "1.0.2" retrofit_version = "2.3.0" + + jackson_version = "2.6.6" play_version = "2.4.11" + + + swagger_annotations_version = "1.5.15" junit_version = "4.12" + + + + json_fire_version = "1.8.0" } @@ -107,14 +119,20 @@ dependencies { compile "com.squareup.retrofit2:retrofit:$retrofit_version" compile "com.squareup.retrofit2:converter-scalars:$retrofit_version" compile "com.squareup.retrofit2:converter-gson:$retrofit_version" + + compile "io.swagger:swagger-annotations:$swagger_annotations_version" compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" compile "io.gsonfire:gson-fire:$json_fire_version" + + + compile "com.typesafe.play:play-java-ws_2.11:$play_version" compile "com.squareup.retrofit2:converter-jackson:$retrofit_version" compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + testCompile "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/retrofit2-play24/build.sbt b/samples/client/petstore/java/retrofit2-play24/build.sbt index 9320633cf84..285b9f96c7f 100644 --- a/samples/client/petstore/java/retrofit2-play24/build.sbt +++ b/samples/client/petstore/java/retrofit2-play24/build.sbt @@ -11,13 +11,23 @@ lazy val root = (project in file(".")). libraryDependencies ++= Seq( "com.squareup.retrofit2" % "retrofit" % "2.3.0" % "compile", "com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile", + + + "com.typesafe.play" % "play-java-ws_2.11" % "2.4.11" % "compile", "com.fasterxml.jackson.core" % "jackson-core" % "2.6.6" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.6.6" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.6.6" % "compile", + + "com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile", + + + "io.swagger" % "swagger-annotations" % "1.5.15" % "compile", - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2" % "compile", + + "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" diff --git a/samples/client/petstore/java/retrofit2-play24/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/retrofit2-play24/docs/AdditionalPropertiesClass.md index 0437c4dd8cc..b37862da7cf 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/AdditionalPropertiesClass.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/Animal.md b/samples/client/petstore/java/retrofit2-play24/docs/Animal.md index b3f325c3524..346caaf63f4 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/Animal.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/Animal.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/AnimalFarm.md b/samples/client/petstore/java/retrofit2-play24/docs/AnimalFarm.md deleted file mode 100644 index c7c7f1ddcce..00000000000 --- a/samples/client/petstore/java/retrofit2-play24/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ - -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - diff --git a/samples/client/petstore/java/retrofit2-play24/docs/AnotherFakeApi.md b/samples/client/petstore/java/retrofit2-play24/docs/AnotherFakeApi.md index bcc1a3a45ce..792799b51e8 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/AnotherFakeApi.md @@ -7,9 +7,11 @@ Method | HTTP request | Description [**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** another-fake/dummy | To test special tags + + # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -22,10 +24,13 @@ To test special tags //import io.swagger.client.api.AnotherFakeApi; + AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +42,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -52,3 +58,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/retrofit2-play24/docs/ArrayOfArrayOfNumberOnly.md index 77292549927..3671a5e9190 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/ArrayOfArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/retrofit2-play24/docs/ArrayOfNumberOnly.md index e8cc4cd36dc..30b9b6648f4 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/ArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/ArrayTest.md b/samples/client/petstore/java/retrofit2-play24/docs/ArrayTest.md index 9feee16427f..4ab76343030 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/ArrayTest.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/ArrayTest.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/Capitalization.md b/samples/client/petstore/java/retrofit2-play24/docs/Capitalization.md index 0f3064c1996..9af7864f97e 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/Capitalization.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/Capitalization.md @@ -13,3 +13,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/Cat.md b/samples/client/petstore/java/retrofit2-play24/docs/Cat.md index 6e9f71ce7dd..5e408344021 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/Cat.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/Cat.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **declawed** | **Boolean** | | [optional] + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/Category.md b/samples/client/petstore/java/retrofit2-play24/docs/Category.md index e2df0803278..deb5a3e2a52 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/Category.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/Category.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/ClassModel.md b/samples/client/petstore/java/retrofit2-play24/docs/ClassModel.md index 64f880c8786..49c281cc0ed 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/ClassModel.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/ClassModel.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/Client.md b/samples/client/petstore/java/retrofit2-play24/docs/Client.md index 5c490ea166c..52b2f72c79c 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/Client.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/Client.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/Dog.md b/samples/client/petstore/java/retrofit2-play24/docs/Dog.md index ac7cea323ff..00e6446e9f5 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/Dog.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/Dog.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **breed** | **String** | | [optional] + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/EnumArrays.md b/samples/client/petstore/java/retrofit2-play24/docs/EnumArrays.md index 4dddc0bfd27..939a0e69587 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/EnumArrays.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/EnumArrays.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] + ## Enum: JustSymbolEnum Name | Value @@ -20,8 +21,6 @@ DOLLAR | "$" ## Enum: List<ArrayEnumEnum> Name | Value ---- | ----- -FISH | "fish" -CRAB | "crab" diff --git a/samples/client/petstore/java/retrofit2-play24/docs/EnumTest.md b/samples/client/petstore/java/retrofit2-play24/docs/EnumTest.md index 08fee344882..9722c621962 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/EnumTest.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] + ## Enum: EnumStringEnum 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 3e052dea273..6d1d77bdf10 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/FakeApi.md @@ -15,6 +15,8 @@ Method | HTTP request | Description [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** fake/jsonFormData | test json serialization of form data + + # **fakeOuterBooleanSerialize** > Boolean fakeOuterBooleanSerialize(body) @@ -30,8 +32,11 @@ Test serialization of outer boolean types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body + +Boolean body = ; // Boolean | Input boolean as post body + try { Boolean result = apiInstance.fakeOuterBooleanSerialize(body); System.out.println(result); @@ -47,6 +52,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + ### Return type **Boolean** @@ -57,12 +63,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outercomposite) @@ -75,10 +82,13 @@ Test serialization of object with outer number type //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body + +OuterComposite 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 +100,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outercomposite** | [**OuterComposite**](.md)| Input composite as post body | [optional] + ### Return type @@ -102,8 +113,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterNumberSerialize** @@ -120,8 +132,11 @@ Test serialization of outer number types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body + +BigDecimal body = ; // BigDecimal | Input number as post body + try { BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); System.out.println(result); @@ -137,6 +152,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + ### Return type [**BigDecimal**](BigDecimal.md) @@ -147,8 +163,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterStringSerialize** @@ -165,8 +182,11 @@ Test serialization of outer string types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String body = "body_example"; // String | Input string as post body + +String body = ; // String | Input string as post body + try { String result = apiInstance.fakeOuterStringSerialize(body); System.out.println(result); @@ -182,6 +202,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**String**](String.md)| Input string as post body | [optional] + ### Return type **String** @@ -192,12 +213,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -210,10 +232,13 @@ To test \"client\" model //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +250,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -240,9 +266,10 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + # **testEndpointParameters** -> Void testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) +> Void testEndpointParameters(body) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -251,36 +278,17 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### 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.FakeApi; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure HTTP basic authorization: http_basic_test -HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); -http_basic_test.setUsername("YOUR USERNAME"); -http_basic_test.setPassword("YOUR PASSWORD"); 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 -Integer integer = 56; // Integer | None -Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None -Float _float = 3.4F; // Float | None -String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None -LocalDate date = new LocalDate(); // LocalDate | None -OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None -String password = "password_example"; // String | None -String paramCallback = "paramCallback_example"; // String | None + +Object body = ; // Object | + try { - Void result = apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + Void result = apiInstance.testEndpointParameters(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEndpointParameters"); @@ -292,20 +300,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **BigDecimal**| None | - **_double** | **Double**| None | - **patternWithoutDelimiter** | **String**| None | - **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] - **int64** | **Long**| None | [optional] - **_float** | **Float**| None | [optional] - **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] - **date** | **LocalDate**| None | [optional] - **dateTime** | **OffsetDateTime**| None | [optional] - **password** | **String**| None | [optional] - **paramCallback** | **String**| None | [optional] + **body** | [**Object**](Object.md)| | + ### Return type @@ -318,11 +314,12 @@ Name | Type | Description | Notes ### 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 + - **Accept**: Not defined + # **testEnumParameters** -> Void testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> Void testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger) To test enum parameters @@ -335,17 +332,23 @@ To test enum parameters //import io.swagger.client.api.FakeApi; + 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) + +Object body = ; // Object | + List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) -String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + +String enumHeaderString = Arrays.asList("enumHeaderString_example"); // 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) + +String enumQueryString = Arrays.asList("enumQueryString_example"); // String | Query parameter enum test (string) + +Integer enumQueryInteger = Arrays.asList(56); // Integer | Query parameter enum test (double) + try { - Void result = apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + Void result = apiInstance.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); @@ -357,14 +360,13 @@ 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] + **body** | [**Object**](Object.md)| | [optional] + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: ] + **enumHeaderString** | [**String**](.md)| Header parameter enum test (string) | [optional] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: ] + **enumQueryString** | [**String**](.md)| Query parameter enum test (string) | [optional] + **enumQueryInteger** | [**Integer**](.md)| Query parameter enum test (double) | [optional] + ### Return type @@ -377,16 +379,15 @@ No authorization required ### HTTP request headers - **Content-Type**: */* - - **Accept**: */* + - **Accept**: Not defined + # **testInlineAdditionalProperties** -> Void testInlineAdditionalProperties(param) +> Void testInlineAdditionalProperties(body) test inline additionalProperties - - ### Example ```java // Import classes: @@ -394,10 +395,13 @@ test inline additionalProperties //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body + +Map body = ; // Map | request body + try { - Void result = apiInstance.testInlineAdditionalProperties(param); + Void result = apiInstance.testInlineAdditionalProperties(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); @@ -409,7 +413,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **body** | [**Map<String, String>**](Map.md)| request body | + ### Return type @@ -424,14 +429,13 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined + # **testJsonFormData** -> Void testJsonFormData(param, param2) +> Void testJsonFormData(body) test json serialization of form data - - ### Example ```java // Import classes: @@ -439,11 +443,13 @@ test json serialization of form data //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String param = "param_example"; // String | field1 -String param2 = "param2_example"; // String | field2 + +Object body = ; // Object | + try { - Void result = apiInstance.testJsonFormData(param, param2); + Void result = apiInstance.testJsonFormData(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testJsonFormData"); @@ -455,8 +461,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **String**| field1 | - **param2** | **String**| field2 | + **body** | [**Object**](Object.md)| | + ### Return type @@ -471,3 +477,5 @@ No authorization required - **Content-Type**: application/json - **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 715fed0dc0b..2336289e187 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/FakeClassnameTags123Api.md @@ -7,33 +7,28 @@ Method | HTTP request | Description [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** fake_classname_test | To test class name in snake case + + # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case ### 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.FakeClassnameTags123Api; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure API key authorization: api_key_query -ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); -api_key_query.setApiKey("YOUR API KEY"); -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model + +Client 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 +40,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -60,3 +56,5 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/FormatTest.md b/samples/client/petstore/java/retrofit2-play24/docs/FormatTest.md index c7a3acb3cb7..bc11b93cb26 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/FormatTest.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/FormatTest.md @@ -11,8 +11,8 @@ Name | Type | Description | Notes **_float** | **Float** | | [optional] **_double** | **Double** | | [optional] **string** | **String** | | [optional] -**_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**_byte** | **String** | | +**binary** | **String** | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] @@ -20,3 +20,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/retrofit2-play24/docs/HasOnlyReadOnly.md index c1d0aac5672..5564ddcf28a 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/HasOnlyReadOnly.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/MapTest.md b/samples/client/petstore/java/retrofit2-play24/docs/MapTest.md index 714a97a40d9..74a6fe8ae70 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/MapTest.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/MapTest.md @@ -8,12 +8,11 @@ Name | Type | Description | Notes **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] + ## Enum: Map<String, InnerEnum> Name | Value ---- | ----- -UPPER | "UPPER" -LOWER | "lower" diff --git a/samples/client/petstore/java/retrofit2-play24/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/retrofit2-play24/docs/MixedPropertiesAndAdditionalPropertiesClass.md index b12e2cd70e6..4507481b5a9 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/Model200Response.md b/samples/client/petstore/java/retrofit2-play24/docs/Model200Response.md index 5b3a9a0e46d..8d2cc50bb83 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/Model200Response.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/Model200Response.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/ModelApiResponse.md b/samples/client/petstore/java/retrofit2-play24/docs/ModelApiResponse.md index 3eec8686cc9..06052b202f1 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/ModelApiResponse.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/ModelApiResponse.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/ModelReturn.md b/samples/client/petstore/java/retrofit2-play24/docs/ModelReturn.md index a679b04953e..a7845ba254b 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/ModelReturn.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/ModelReturn.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/Name.md b/samples/client/petstore/java/retrofit2-play24/docs/Name.md index ce2fb4dee50..a8d6fec9714 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/Name.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/Name.md @@ -11,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/NumberOnly.md b/samples/client/petstore/java/retrofit2-play24/docs/NumberOnly.md index a3feac7fadc..adfb36a95bb 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/NumberOnly.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/NumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/Order.md b/samples/client/petstore/java/retrofit2-play24/docs/Order.md index 268c617d1ff..7e4beff6df1 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/Order.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/Order.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/retrofit2-play24/docs/OuterComposite.md b/samples/client/petstore/java/retrofit2-play24/docs/OuterComposite.md index 3f5a633c998..1963c7a0f73 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/OuterComposite.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/OuterComposite.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/Pet.md b/samples/client/petstore/java/retrofit2-play24/docs/Pet.md index 5b63109ef92..1492195a58d 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/Pet.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/Pet.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/retrofit2-play24/docs/PetApi.md b/samples/client/petstore/java/retrofit2-play24/docs/PetApi.md index ea3c05ad412..c5748bb7cd3 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/PetApi.md @@ -14,33 +14,28 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** pet/{petId}/uploadImage | uploads an image + + # **addPet** -> Void addPet(body) +> Void addPet(pet) 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 + +Pet pet = ; // Pet | Pet object that needs to be added to the store + try { - Void result = apiInstance.addPet(body); + Void result = apiInstance.addPet(pet); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); @@ -52,7 +47,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -65,7 +61,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **deletePet** @@ -73,26 +70,20 @@ Name | Type | Description | Notes 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 | + +Integer petId = Arrays.asList(56); // Integer | Pet id to delete + +String apiKey = Arrays.asList("apiKey_example"); // String | + try { Void result = apiInstance.deletePet(petId, apiKey); System.out.println(result); @@ -106,8 +97,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | - **apiKey** | **String**| | [optional] + **petId** | [**Integer**](.md)| Pet id to delete | + **apiKey** | [**String**](.md)| | [optional] + ### Return type @@ -120,7 +112,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **findPetsByStatus** @@ -133,20 +126,15 @@ 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); @@ -160,7 +148,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: ] + ### Return type @@ -175,6 +164,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **findPetsByTags** > List<Pet> findPetsByTags(tags) @@ -186,20 +176,15 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### 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); @@ -215,6 +200,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | + ### Return type [**List<Pet>**](Pet.md) @@ -228,6 +214,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **getPetById** > Pet getPetById(petId) @@ -239,22 +226,15 @@ 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to return + try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -268,7 +248,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to return | + **petId** | [**Integer**](.md)| ID of pet to return | + ### Return type @@ -283,33 +264,27 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **updatePet** -> Void updatePet(body) +> Void updatePet(pet) 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 + +Pet pet = ; // Pet | Pet object that needs to be added to the store + try { - Void result = apiInstance.updatePet(body); + Void result = apiInstance.updatePet(pet); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); @@ -321,7 +296,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -334,37 +310,31 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updatePetWithForm** -> Void updatePetWithForm(petId, name, status) +> Void updatePetWithForm(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet that needs to be updated + +Object body = ; // Object | + try { - Void result = apiInstance.updatePetWithForm(petId, name, status); + Void result = apiInstance.updatePetWithForm(petId, body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePetWithForm"); @@ -376,9 +346,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet that needs to be updated | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -391,37 +361,31 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **uploadFile** -> ModelApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to update + +Object body = ; // Object | + try { - ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); + ModelApiResponse result = apiInstance.uploadFile(petId, body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFile"); @@ -433,9 +397,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet to update | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -450,3 +414,5 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json + + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/ReadOnlyFirst.md b/samples/client/petstore/java/retrofit2-play24/docs/ReadOnlyFirst.md index 426b7cde95a..57655e5b49e 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/ReadOnlyFirst.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/SpecialModelName.md b/samples/client/petstore/java/retrofit2-play24/docs/SpecialModelName.md index c2c6117c552..f4259d2a73c 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/SpecialModelName.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/SpecialModelName.md @@ -4,7 +4,8 @@ ## 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 134f0c36578..35b66fd8485 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/StoreApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/StoreApi.md @@ -10,6 +10,8 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet + + # **deleteOrder** > Void deleteOrder(orderId) @@ -25,8 +27,11 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + +String orderId = Arrays.asList("orderId_example"); // String | ID of the order that needs to be deleted + try { Void result = apiInstance.deleteOrder(orderId); System.out.println(result); @@ -40,7 +45,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | + **orderId** | [**String**](.md)| ID of the order that needs to be deleted | + ### Return type @@ -53,7 +59,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getInventory** @@ -66,21 +73,13 @@ 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); @@ -93,6 +92,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type **Map<String, Integer>** @@ -106,6 +106,7 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json + # **getOrderById** > Order getOrderById(orderId) @@ -121,8 +122,11 @@ For valid response try integer IDs with value <= 5 or > 10. Other val //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched + +Integer orderId = Arrays.asList(56); // Integer | ID of pet that needs to be fetched + try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -136,7 +140,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | [**Integer**](.md)| ID of pet that needs to be fetched | + ### Return type @@ -151,14 +156,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -166,10 +170,13 @@ Place an order for a pet //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet + +Order 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"); @@ -181,7 +188,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](.md)| order placed for purchasing the pet | + ### Return type @@ -193,6 +201,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: */* - **Accept**: application/xml, application/json + + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/Tag.md b/samples/client/petstore/java/retrofit2-play24/docs/Tag.md index de6814b55d5..7a97d4c6812 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/Tag.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/Tag.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/User.md b/samples/client/petstore/java/retrofit2-play24/docs/User.md index 8b6753dd284..cf7f9ce1312 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/User.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/User.md @@ -15,3 +15,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/UserApi.md b/samples/client/petstore/java/retrofit2-play24/docs/UserApi.md index 40096ec05bc..619b98b9fa7 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/UserApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/UserApi.md @@ -14,9 +14,11 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** user/{username} | Updated user + + # **createUser** -> Void createUser(body) +> Void createUser(user) Create user @@ -29,10 +31,13 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object + +User user = ; // User | Created user object + try { - Void result = apiInstance.createUser(body); + Void result = apiInstance.createUser(user); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); @@ -44,7 +49,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](.md)| Created user object | + ### Return type @@ -56,8 +62,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithArrayInput** @@ -65,8 +72,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -74,8 +79,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { Void result = apiInstance.createUsersWithArrayInput(body); System.out.println(result); @@ -91,6 +99,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type [**Void**](.md) @@ -101,8 +110,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithListInput** @@ -110,8 +120,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -119,8 +127,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { Void result = apiInstance.createUsersWithListInput(body); System.out.println(result); @@ -136,6 +147,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type [**Void**](.md) @@ -146,8 +158,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **deleteUser** @@ -164,8 +177,11 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be deleted + +String username = Arrays.asList("username_example"); // String | The name that needs to be deleted + try { Void result = apiInstance.deleteUser(username); System.out.println(result); @@ -179,7 +195,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | + **username** | [**String**](.md)| The name that needs to be deleted | + ### Return type @@ -192,7 +209,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getUserByName** @@ -200,8 +218,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -209,8 +225,11 @@ Get user by user name //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. + +String username = Arrays.asList("username_example"); // String | The name that needs to be fetched. Use user1 for testing. + try { User result = apiInstance.getUserByName(username); System.out.println(result); @@ -224,7 +243,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + **username** | [**String**](.md)| The name that needs to be fetched. Use user1 for testing. | + ### Return type @@ -239,14 +259,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **loginUser** > String loginUser(username, password) Logs user into the system - - ### Example ```java // Import classes: @@ -254,9 +273,13 @@ Logs user into the system //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 + +String username = Arrays.asList("username_example"); // String | The user name for login + +String password = Arrays.asList("password_example"); // String | The password for login in clear text + try { String result = apiInstance.loginUser(username, password); System.out.println(result); @@ -270,8 +293,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | + **username** | [**String**](.md)| The user name for login | + **password** | [**String**](.md)| The password for login in clear text | + ### Return type @@ -286,14 +310,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **logoutUser** > Void logoutUser() Logs out current logged in user session - - ### Example ```java // Import classes: @@ -301,7 +324,9 @@ Logs out current logged in user session //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); + try { Void result = apiInstance.logoutUser(); System.out.println(result); @@ -314,6 +339,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type [**Void**](.md) @@ -325,11 +351,12 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updateUser** -> Void updateUser(username, body) +> Void updateUser(user, username) Updated user @@ -342,11 +369,15 @@ This can only be done by the logged in user. //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 + +User user = ; // User | Updated user object + +String username = Arrays.asList("username_example"); // String | name that need to be deleted + try { - Void result = apiInstance.updateUser(username, body); + Void result = apiInstance.updateUser(user, username); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); @@ -358,8 +389,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](.md)| Updated user object | + **username** | [**String**](.md)| name that need to be deleted | + ### Return type @@ -371,6 +403,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + + diff --git a/samples/client/petstore/java/retrofit2-play24/git_push.sh b/samples/client/petstore/java/retrofit2-play24/git_push.sh index ae01b182ae9..ed374619b13 100644 --- a/samples/client/petstore/java/retrofit2-play24/git_push.sh +++ b/samples/client/petstore/java/retrofit2-play24/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 credential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential 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/retrofit2-play24/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/retrofit2-play24/gradle/wrapper/gradle-wrapper.jar index 2c6137b8789..e69de29bb2d 100644 Binary files a/samples/client/petstore/java/retrofit2-play24/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/retrofit2-play24/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/retrofit2-play24/pom.xml b/samples/client/petstore/java/retrofit2-play24/pom.xml index 3841cd6f1e1..d59d2291a3f 100644 --- a/samples/client/petstore/java/retrofit2-play24/pom.xml +++ b/samples/client/petstore/java/retrofit2-play24/pom.xml @@ -1,276 +1,274 @@ - 4.0.0 - io.swagger - swagger-java-client - jar - swagger-java-client - 1.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-java-client + jar + swagger-java-client + 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 - 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 + - - - 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 - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - 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.2 - - - - jar - test-jar - - - - - - + + + + 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.codehaus.mojo - build-helper-maven-plugin - 1.10 - - - 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-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + 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-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} - - - com.squareup.retrofit2 - converter-gson - ${retrofit-version} - - - com.squareup.retrofit2 - retrofit - ${retrofit-version} - - - com.squareup.retrofit2 - converter-scalars - ${retrofit-version} - - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - ${oltu-version} - - - io.gsonfire - gson-fire - ${gson-fire-version} - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + - - - com.squareup.retrofit2 - converter-jackson - ${retrofit-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.typesafe.play - play-java-ws_2.11 - ${play-version} - + + + io.swagger + swagger-annotations + ${swagger-core-version} + + + com.squareup.retrofit2 + converter-gson + ${retrofit-version} + + + com.squareup.retrofit2 + retrofit + ${retrofit-version} + + + com.squareup.retrofit2 + converter-scalars + ${retrofit-version} + + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + ${oltu-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + + + + + + + com.squareup.retrofit2 + converter-jackson + ${retrofit-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.typesafe.play + play-java-ws_2.11 + ${play-version} + + + + - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.8 - ${java.version} - ${java.version} - 1.8.0 - 1.5.15 - 2.6.6 - 2.4.11 - 2.3.0 - 1.0.1 - 4.12 - + + + junit + junit + ${junit-version} + test + + + + UTF-8 + 1.8 + ${java.version} + ${java.version} + 1.8.0 + 1.5.15 + + + 2.6.6 + 2.4.11 + + + + 2.3.0 + + + + + 1.0.2 + 4.12 + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/Play24CallAdapterFactory.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/Play24CallAdapterFactory.java index 0ee38e9d5df..6883c237140 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/Play24CallAdapterFactory.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/Play24CallAdapterFactory.java @@ -50,7 +50,7 @@ private CallAdapter> createAdapter(ParameterizedType returnType) } /** - * Adapter that coverts values returned by API interface into CompletionStage + * Adpater that coverts values returned by API interface into CompletionStage */ private static final class ValueAdapter implements CallAdapter> { 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..d5944b6ade5 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 @@ -11,27 +11,43 @@ import io.swagger.client.model.Client; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import play.libs.F; import retrofit2.Response; + 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({ "Content-Type:application/json" }) + + + @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..e01c8bdf546 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 @@ -11,146 +11,249 @@ import java.math.BigDecimal; import io.swagger.client.model.Client; -import java.time.LocalDate; -import java.time.OffsetDateTime; import io.swagger.client.model.OuterComposite; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import play.libs.F; import retrofit2.Response; + public interface FakeApi { + /** * * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Call<Boolean> */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("fake/outer/boolean") F.Promise> fakeOuterBooleanSerialize( @retrofit2.http.Body Boolean body ); + /** * * 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> */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("fake/outer/composite") F.Promise> fakeOuterCompositeSerialize( - @retrofit2.http.Body OuterComposite body + @retrofit2.http.Body OuterComposite outercomposite ); + /** * * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return Call<BigDecimal> */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("fake/outer/number") F.Promise> fakeOuterNumberSerialize( @retrofit2.http.Body BigDecimal body ); + /** * * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return Call<String> */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("fake/outer/string") F.Promise> fakeOuterStringSerialize( @retrofit2.http.Body String body ); + /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + + * @param client client model (required) + * @return Call<Client> */ + + + + @Headers({ "Content-Type:application/json" }) + + + @PATCH("fake") F.Promise> testClientModel( - @retrofit2.http.Body Client body + @retrofit2.http.Body Client client ); + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) + + * @param body (required) + * @return Call<Void> */ - @retrofit2.http.FormUrlEncoded + + + + + @Headers({ + "Content-Type:application/json; charset=utf-8" + }) + + + + + @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.Body Object body ); + /** * 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 body (optional) + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + + * @param enumHeaderString Header parameter enum test (string) (optional) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + + * @param enumQueryString Query parameter enum test (string) (optional) + * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) + * @return Call<Void> */ - @retrofit2.http.FormUrlEncoded + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @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.Body Object body, @retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Path("enum_query_string_array") List enumQueryStringArray, @retrofit2.http.Path("enum_query_string") String enumQueryString, @retrofit2.http.Path("enum_query_integer") Integer enumQueryInteger ); + /** * test inline additionalProperties * - * @param param request body (required) + + * @param body request body (required) + * @return Call<Void> */ + + + + @Headers({ "Content-Type:application/json" }) + + + @POST("fake/inline-additionalProperties") F.Promise> testInlineAdditionalProperties( - @retrofit2.http.Body Object param + @retrofit2.http.Body Map body ); + /** * test json serialization of form data * - * @param param field1 (required) - * @param param2 field2 (required) + + * @param body (required) + * @return Call<Void> */ - @retrofit2.http.FormUrlEncoded + + + + + @Headers({ + "Content-Type:application/json" + }) + + + @GET("fake/jsonFormData") F.Promise> testJsonFormData( - @retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2 + @retrofit2.http.Body Object body ); + } + 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 1aef86538fe..6795082599f 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 @@ -11,27 +11,43 @@ import io.swagger.client.model.Client; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import play.libs.F; import retrofit2.Response; + public interface FakeClassnameTags123Api { + /** * To test class name in snake case * - * @param body client model (required) + + * @param client client model (required) + * @return Call<Client> */ + + + + @Headers({ "Content-Type:application/json" }) + + + @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 0102aea1c13..e8a453eb357 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 @@ -9,118 +9,194 @@ import okhttp3.RequestBody; -import java.io.File; import io.swagger.client.model.ModelApiResponse; import io.swagger.client.model.Pet; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import play.libs.F; import retrofit2.Response; + 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({ "Content-Type:application/json" }) + + + + + @POST("pet") F.Promise> addPet( - @retrofit2.http.Body Pet body + @retrofit2.http.Body Pet pet ); + /** * Deletes a pet * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Call<Void> */ + + + + @DELETE("pet/{petId}") F.Promise> deletePet( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Header("api_key") String apiKey + @retrofit2.http.Path("petId") Integer petId, @retrofit2.http.Header("api_key") String apiKey ); + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @return Call<List<Pet>> */ + + + + @GET("pet/findByStatus") F.Promise>> findPetsByStatus( - @retrofit2.http.Query("status") CSVParams status + @retrofit2.http.Path("status") List status ); + /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @return Call<List<Pet>> */ + + + + @GET("pet/findByTags") F.Promise>> findPetsByTags( - @retrofit2.http.Query("tags") CSVParams tags + @retrofit2.http.Path("tags") List tags ); + /** * Find pet by ID * Returns a single pet + * @param petId ID of pet to return (required) + * @return Call<Pet> */ + + + + @GET("pet/{petId}") F.Promise> getPetById( - @retrofit2.http.Path("petId") Long petId + @retrofit2.http.Path("petId") Integer petId ); + /** * 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({ "Content-Type:application/json" }) + + + + + @PUT("pet") F.Promise> updatePet( - @retrofit2.http.Body Pet body + @retrofit2.http.Body Pet pet ); + /** * Updates a pet in the store with form data * + * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) + + * @param body (optional) + * @return Call<Void> */ - @retrofit2.http.FormUrlEncoded + + + + + @Headers({ + "Content-Type:application/x-www-form-urlencoded" + }) + + + @POST("pet/{petId}") F.Promise> updatePetWithForm( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Field("name") String name, @retrofit2.http.Field("status") String status + @retrofit2.http.Path("petId") Integer petId, @retrofit2.http.Body Object body ); + /** * uploads an image * + * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) + + * @param body (optional) + * @return Call<ModelApiResponse> */ - @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 okhttp3.MultipartBody.Part file + @retrofit2.http.Path("petId") Integer petId, @retrofit2.http.Body Object body ); + } + 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..eb534af1601 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 @@ -11,55 +11,94 @@ import io.swagger.client.model.Order; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import play.libs.F; import retrofit2.Response; + public interface StoreApi { + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @return Call<Void> */ + + + + @DELETE("store/order/{order_id}") F.Promise> deleteOrder( @retrofit2.http.Path("order_id") String orderId ); + /** * Returns pet inventories by status * Returns a map of status codes to quantities + * @return Call<Map<String, Integer>> */ + + + + @GET("store/inventory") F.Promise>> getInventory(); + /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @return Call<Order> */ + + + + @GET("store/order/{order_id}") F.Promise> getOrderById( - @retrofit2.http.Path("order_id") Long orderId + @retrofit2.http.Path("order_id") Integer orderId ); + /** * 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> */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @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 9b553463002..14e914a97e4 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 @@ -11,101 +11,188 @@ import io.swagger.client.model.User; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import play.libs.F; import retrofit2.Response; + 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> */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @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) + * @return Call<Void> */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("user/createWithArray") F.Promise> createUsersWithArrayInput( @retrofit2.http.Body List body ); + /** * Creates list of users with given input array * + * @param body List of user object (required) + * @return Call<Void> */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("user/createWithList") F.Promise> createUsersWithListInput( @retrofit2.http.Body List body ); + /** * Delete user * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @return Call<Void> */ + + + + @DELETE("user/{username}") F.Promise> deleteUser( @retrofit2.http.Path("username") String username ); + /** * Get user by user name * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return Call<User> */ + + + + @GET("user/{username}") F.Promise> getUserByName( @retrofit2.http.Path("username") String username ); + /** * Logs user into the system * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return Call<String> */ + + + + @GET("user/login") F.Promise> loginUser( - @retrofit2.http.Query("username") String username, @retrofit2.http.Query("password") String password + @retrofit2.http.Path("username") String username, @retrofit2.http.Path("password") String password ); + /** * Logs out current logged in user session * + * @return Call<Void> */ + + + + @GET("user/logout") F.Promise> logoutUser(); + /** * Updated user * This can only be done by the logged in user. + + * @param user Updated user object (required) + * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @return Call<Void> */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @PUT("user/{username}") F.Promise> updateUser( - @retrofit2.http.Path("username") String username, @retrofit2.http.Body User body + @retrofit2.http.Body User user, @retrofit2.http.Path("username") String username ); + } + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index f03052a0c41..81d0bb3f252 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -30,66 +30,79 @@ */ public class AdditionalPropertiesClass { + @JsonProperty("map_property") private Map mapProperty = null; - + @JsonProperty("map_of_map_property") private Map> mapOfMapProperty = null; - + public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; return this; } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { this.mapProperty = new HashMap<>(); } + this.mapProperty.put(key, mapPropertyItem); return this; } - - /** - * Get mapProperty - * @return mapProperty + /** + * Get mapProperty + * @return mapProperty **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } - public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } - + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; return this; } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { this.mapOfMapProperty = new HashMap<>(); } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } - - /** - * Get mapOfMapProperty - * @return mapOfMapProperty + /** + * Get mapOfMapProperty + * @return mapOfMapProperty **/ + + + + @Valid - @ApiModelProperty(value = "") + + + + +@ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -107,8 +120,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapProperty, mapOfMapProperty); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -131,5 +143,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Animal.java index 023cb11b7eb..abd1a26a6bc 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Animal.java @@ -27,57 +27,72 @@ /** * Animal */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true ) + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Discriminator{propertyName='className', mapping=null}", visible = true ) @JsonSubTypes({ + @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + }) public class Animal { + @JsonProperty("className") private String className = null; - + @JsonProperty("color") private String color = "red"; - + public Animal className(String className) { this.className = className; return this; } - /** - * Get className - * @return className + + /** + * Get className + * @return className **/ + @NotNull - @ApiModelProperty(required = true, value = "") + + + + + +@ApiModelProperty(required = true, value = "") public String getClassName() { return className; } - public void setClassName(String className) { this.className = className; } - + public Animal color(String color) { this.color = color; return this; } - /** - * Get color - * @return color + + /** + * Get color + * @return color **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getColor() { return color; } - public void setColor(String color) { this.color = color; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -95,8 +110,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(className, color); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -119,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AnimalFarm.java deleted file mode 100644 index fc38d86a0aa..00000000000 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/AnimalFarm.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 io.swagger.client.model.Animal; -import java.util.ArrayList; -import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index a5f6292b7b4..b43473676c5 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -30,37 +30,46 @@ */ public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") private List> arrayArrayNumber = null; - + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; return this; } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { this.arrayArrayNumber = new ArrayList<>(); } + this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber **/ + + + + @Valid - @ApiModelProperty(value = "") + + + + +@ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } - public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -77,8 +86,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayArrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 443501f0598..4f8590a490c 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -30,37 +30,46 @@ */ public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") private List arrayNumber = null; - + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; return this; } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { this.arrayNumber = new ArrayList<>(); } + this.arrayNumber.add(arrayNumberItem); return this; } - - /** - * Get arrayNumber - * @return arrayNumber + + /** + * Get arrayNumber + * @return arrayNumber **/ + + + + @Valid - @ApiModelProperty(value = "") + + + + +@ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } - public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -77,8 +86,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayTest.java index 4934689e7dc..912f7dbb2a4 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ArrayTest.java @@ -30,96 +30,120 @@ */ public class ArrayTest { + @JsonProperty("array_of_string") private List arrayOfString = null; - + @JsonProperty("array_array_of_integer") private List> arrayArrayOfInteger = null; - + @JsonProperty("array_array_of_model") private List> arrayArrayOfModel = null; - + public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; return this; } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { this.arrayOfString = new ArrayList<>(); } + this.arrayOfString.add(arrayOfStringItem); return this; } - - /** - * Get arrayOfString - * @return arrayOfString + + /** + * Get arrayOfString + * @return arrayOfString **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } - public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } - + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { this.arrayArrayOfInteger = new ArrayList<>(); } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger **/ + + + + @Valid - @ApiModelProperty(value = "") + + + + +@ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } - + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { this.arrayArrayOfModel = new ArrayList<>(); } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel **/ + + + + @Valid - @ApiModelProperty(value = "") + + + + +@ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } - public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -138,8 +162,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -163,5 +186,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Capitalization.java index e7a0b0ac935..ccc6cc11d91 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Capitalization.java @@ -27,133 +27,163 @@ */ public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel = null; - + @JsonProperty("CapitalCamel") private String capitalCamel = null; - + @JsonProperty("small_Snake") private String smallSnake = null; - + @JsonProperty("Capital_Snake") private String capitalSnake = null; - + @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints = null; - + @JsonProperty("ATT_NAME") private String ATT_NAME = null; - + public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; return this; } - /** - * Get smallCamel - * @return smallCamel + + /** + * Get smallCamel + * @return smallCamel **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } - public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } - + public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; return this; } - /** - * Get capitalCamel - * @return capitalCamel + + /** + * Get capitalCamel + * @return capitalCamel **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } - public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } - + public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; return this; } - /** - * Get smallSnake - * @return smallSnake + + /** + * Get smallSnake + * @return smallSnake **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } - public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } - + public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; return this; } - /** - * Get capitalSnake - * @return capitalSnake + + /** + * Get capitalSnake + * @return capitalSnake **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } - public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } - + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; return this; } - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } - public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } - + public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; return this; } - /** - * Name of the pet - * @return ATT_NAME + + /** + * Name of the pet + * @return ATT_NAME **/ - @ApiModelProperty(value = "Name of the pet ") + + + + + +@ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } - public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -175,8 +205,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -203,5 +232,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Cat.java index 7c513d6d6dd..67d48202332 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Cat.java @@ -28,28 +28,87 @@ */ public class Cat extends Animal { + + @JsonProperty("className") + private String className = null; + + @JsonProperty("color") + private String color = "red"; + @JsonProperty("declawed") private Boolean declawed = null; + + public Cat className(String className) { + this.className = className; + return this; + } + + + /** + * Get className + * @return className + **/ + + @NotNull + + + + + +@ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Cat color(String color) { + this.color = color; + return this; + } + + + /** + * Get color + * @return color + **/ + + + + +@ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; } - /** - * Get declawed - * @return declawed + + /** + * Get declawed + * @return declawed **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Boolean isDeclawed() { return declawed; } - public void setDeclawed(Boolean declawed) { this.declawed = declawed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -59,21 +118,24 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && + return Objects.equals(this.className, cat.className) && + Objects.equals(this.color, cat.color) && + Objects.equals(this.declawed, cat.declawed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(declawed, super.hashCode()); + return Objects.hash(className, color, declawed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); sb.append("}"); return sb.toString(); @@ -90,5 +152,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Category.java index bf8840d5fcf..62f8513c081 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Category.java @@ -27,49 +27,59 @@ */ public class Category { + @JsonProperty("id") private Long id = null; - + @JsonProperty("name") private String name = null; - + public Category id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Category name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -87,8 +97,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -111,5 +120,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ClassModel.java index f3d9160e3db..bdd7c3f6108 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ClassModel.java @@ -24,32 +24,36 @@ /** * Model for testing model with \"_class\" property - */ -@ApiModel(description = "Model for testing model with \"_class\" property") + */@ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { + @JsonProperty("_class") private String propertyClass = null; - + public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -66,8 +70,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,5 +92,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Client.java index a09f13e7a2c..a7d9ace732d 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Client.java @@ -27,28 +27,33 @@ */ public class Client { + @JsonProperty("client") private String client = null; - + public Client client(String client) { this.client = client; return this; } - /** - * Get client - * @return client + + /** + * Get client + * @return client **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getClient() { return client; } - public void setClient(String client) { this.client = client; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -65,8 +70,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(client); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -88,5 +92,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Dog.java index 3835e2aca37..59d3c8dadc1 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Dog.java @@ -28,28 +28,87 @@ */ public class Dog extends Animal { + + @JsonProperty("className") + private String className = null; + + @JsonProperty("color") + private String color = "red"; + @JsonProperty("breed") private String breed = null; + + public Dog className(String className) { + this.className = className; + return this; + } + + + /** + * Get className + * @return className + **/ + + @NotNull + + + + + +@ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Dog color(String color) { + this.color = color; + return this; + } + + + /** + * Get color + * @return color + **/ + + + + +@ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Dog breed(String breed) { this.breed = breed; return this; } - /** - * Get breed - * @return breed + + /** + * Get breed + * @return breed **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getBreed() { return breed; } - public void setBreed(String breed) { this.breed = breed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -59,21 +118,24 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && + return Objects.equals(this.className, dog.className) && + Objects.equals(this.color, dog.color) && + Objects.equals(this.breed, dog.breed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(breed, super.hashCode()); + return Objects.hash(className, color, breed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); sb.append("}"); return sb.toString(); @@ -90,5 +152,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java index f3cff0ea172..4506c62fe6b 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java @@ -29,12 +29,13 @@ */ public class EnumArrays { - /** + + /** * Gets or Sets justSymbol */ public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), + GREATER_THAN_OR_EQUAL_TO(">="), DOLLAR("$"); private String value; @@ -42,8 +43,9 @@ public enum JustSymbolEnum { JustSymbolEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -52,8 +54,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static JustSymbolEnum fromValue(String text) { for (JustSymbolEnum b : JustSymbolEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -62,17 +65,20 @@ public static JustSymbolEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("just_symbol") private JustSymbolEnum justSymbol = null; - - /** + + + /** * Gets or Sets arrayEnum */ public enum ArrayEnumEnum { - FISH("fish"), + FISH("fish"), CRAB("crab"); private String value; @@ -80,8 +86,9 @@ public enum ArrayEnumEnum { ArrayEnumEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -90,8 +97,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static ArrayEnumEnum fromValue(String text) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -100,56 +108,67 @@ public static ArrayEnumEnum fromValue(String text) { } return null; } + } - + @JsonProperty("array_enum") private List arrayEnum = null; - + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; return this; } - /** - * Get justSymbol - * @return justSymbol + + /** + * Get justSymbol + * @return justSymbol **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } - public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } - + public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; return this; } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { this.arrayEnum = new ArrayList<>(); } + this.arrayEnum.add(arrayEnumItem); return this; } - - /** - * Get arrayEnum - * @return arrayEnum + + /** + * Get arrayEnum + * @return arrayEnum **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } - public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -167,8 +186,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -191,5 +209,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumClass.java index f3211289d46..9414211ef6c 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumClass.java @@ -13,16 +13,17 @@ package io.swagger.client.model; -import java.util.Objects; -import javax.validation.constraints.*; -import javax.validation.Valid; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + + /** * Gets or Sets EnumClass */ + public enum EnumClass { _ABC("_abc"), @@ -37,7 +38,9 @@ public enum EnumClass { this.value = value; } + @JsonValue + public String getValue() { return value; } @@ -47,7 +50,9 @@ public String toString() { return String.valueOf(value); } + @JsonCreator + public static EnumClass fromValue(String text) { for (EnumClass b : EnumClass.values()) { if (String.valueOf(b.value).equals(text)) { @@ -56,5 +61,8 @@ public static EnumClass fromValue(String text) { } return null; } + } + + 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 779c3abcc1b..fe21368b7fe 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 @@ -28,14 +28,14 @@ */ public class EnumTest { - /** + + /** * Gets or Sets enumString */ public enum EnumStringEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"), - EMPTY(""); private String value; @@ -43,8 +43,9 @@ public enum EnumStringEnum { EnumStringEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -53,8 +54,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumStringEnum fromValue(String text) { for (EnumStringEnum b : EnumStringEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -63,17 +65,19 @@ public static EnumStringEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_string") private EnumStringEnum enumString = null; - - /** + + /** * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(1), NUMBER_MINUS_1(-1); private Integer value; @@ -81,8 +85,9 @@ public enum EnumIntegerEnum { EnumIntegerEnum(Integer value) { this.value = value; } - + @JsonValue + public Integer getValue() { return value; } @@ -91,8 +96,9 @@ public Integer getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumIntegerEnum fromValue(String text) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -101,17 +107,19 @@ public static EnumIntegerEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger = null; - - /** + + /** * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(1.1), NUMBER_MINUS_1_DOT_2(-1.2); private Double value; @@ -119,8 +127,9 @@ public enum EnumNumberEnum { EnumNumberEnum(Double value) { this.value = value; } - + @JsonValue + public Double getValue() { return value; } @@ -129,8 +138,9 @@ public Double getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumNumberEnum fromValue(String text) { for (EnumNumberEnum b : EnumNumberEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -139,88 +149,110 @@ public static EnumNumberEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_number") private EnumNumberEnum enumNumber = null; - + @JsonProperty("outerEnum") private OuterEnum outerEnum = null; - + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; } - /** - * Get enumString - * @return enumString + + /** + * Get enumString + * @return enumString **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } - public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } - + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; } - /** - * Get enumInteger - * @return enumInteger + + /** + * Get enumInteger + * @return enumInteger **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } - public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } - + public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; return this; } - /** - * Get enumNumber - * @return enumNumber + + /** + * Get enumNumber + * @return enumNumber **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } - public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - + public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; return this; } - /** - * Get outerEnum - * @return outerEnum + + /** + * Get outerEnum + * @return outerEnum **/ + + + + @Valid - @ApiModelProperty(value = "") + + +@ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,8 +272,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -266,5 +297,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\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 1d332a76d97..c6e2698c173 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 @@ -31,298 +31,365 @@ */ public class FormatTest { + @JsonProperty("integer") private Integer integer = null; - + @JsonProperty("int32") private Integer int32 = null; - + @JsonProperty("int64") private Long int64 = null; - + @JsonProperty("number") private BigDecimal number = null; - + @JsonProperty("float") private Float _float = null; - + @JsonProperty("double") private Double _double = null; - + @JsonProperty("string") private String string = null; - + @JsonProperty("byte") - private byte[] _byte = null; - + private String _byte = null; + @JsonProperty("binary") - private byte[] binary = null; - + private String binary = null; + @JsonProperty("date") private LocalDate date = null; - + @JsonProperty("dateTime") private OffsetDateTime dateTime = null; - + @JsonProperty("uuid") private UUID uuid = null; - + @JsonProperty("password") private String password = null; - + public FormatTest integer(Integer integer) { this.integer = integer; return this; } - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer **/ - @Min(10) @Max(100) @ApiModelProperty(value = "") + + + + + + @Min(10) @Max(100)@ApiModelProperty(value = "") public Integer getInteger() { return integer; } - public void setInteger(Integer integer) { this.integer = integer; } - + public FormatTest int32(Integer int32) { this.int32 = int32; return this; } - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 **/ - @Min(20) @Max(200) @ApiModelProperty(value = "") + + + + + + @Min(20) @Max(200)@ApiModelProperty(value = "") public Integer getInt32() { return int32; } - public void setInt32(Integer int32) { this.int32 = int32; } - + public FormatTest int64(Long int64) { this.int64 = int64; return this; } - /** - * Get int64 - * @return int64 + + /** + * Get int64 + * @return int64 **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Long getInt64() { return int64; } - public void setInt64(Long int64) { this.int64 = int64; } - + public FormatTest number(BigDecimal number) { this.number = number; return this; } - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number + + /** + * Get number + * @return number **/ + @NotNull + + + + @Valid - @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") + + +@ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } - public void setNumber(BigDecimal number) { this.number = number; } - + public FormatTest _float(Float _float) { this._float = _float; return this; } - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float + + /** + * Get _float + * @return _float **/ - @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Float getFloat() { return _float; } - public void setFloat(Float _float) { this._float = _float; } - + public FormatTest _double(Double _double) { this._double = _double; return this; } - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double + + /** + * Get _double + * @return _double **/ - @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Double getDouble() { return _double; } - public void setDouble(Double _double) { this._double = _double; } - + public FormatTest string(String string) { this.string = string; return this; } - /** - * Get string - * @return string + + /** + * Get string + * @return string **/ - @Pattern(regexp="/[a-z]/i") @ApiModelProperty(value = "") + + + + + + @Pattern(regexp="/[a-z]/i")@ApiModelProperty(value = "") public String getString() { return string; } - public void setString(String string) { this.string = string; } - - public FormatTest _byte(byte[] _byte) { + + public FormatTest _byte(String _byte) { this._byte = _byte; return this; } - /** - * Get _byte - * @return _byte + + /** + * Get _byte + * @return _byte **/ + @NotNull - @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") @ApiModelProperty(required = true, value = "") - public byte[] getByte() { + + + + + + @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$")@ApiModelProperty(required = true, value = "") + public String getByte() { return _byte; } - - public void setByte(byte[] _byte) { + public void setByte(String _byte) { this._byte = _byte; } - - public FormatTest binary(byte[] binary) { + + public FormatTest binary(String binary) { this.binary = binary; return this; } - /** - * Get binary - * @return binary + + /** + * Get binary + * @return binary **/ - @ApiModelProperty(value = "") - public byte[] getBinary() { + + + + + +@ApiModelProperty(value = "") + public String getBinary() { return binary; } - - public void setBinary(byte[] binary) { + public void setBinary(String binary) { this.binary = binary; } - + public FormatTest date(LocalDate date) { this.date = date; return this; } - /** - * Get date - * @return date + + /** + * Get date + * @return date **/ + @NotNull + + + + @Valid - @ApiModelProperty(required = true, value = "") + + +@ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } - public void setDate(LocalDate date) { this.date = date; } - + public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ + + + + @Valid - @ApiModelProperty(value = "") + + +@ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ + + + + @Valid - @ApiModelProperty(value = "") + + +@ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public FormatTest password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ + @NotNull - @Size(min=10,max=64) @ApiModelProperty(required = true, value = "") + + + + + +@ApiModelProperty(required = true, value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -351,8 +418,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -386,5 +452,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 5f86fb84a96..ea805fbd8db 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -27,31 +27,43 @@ */ public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar = null; - + @JsonProperty("foo") private String foo = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getBar() { return bar; } - - /** - * Get foo - * @return foo + + + /** + * Get foo + * @return foo **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getFoo() { return foo; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -69,8 +81,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, foo); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -93,5 +104,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java index 1a15255161d..adc34662ea1 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java @@ -30,15 +30,17 @@ */ public class MapTest { + @JsonProperty("map_map_of_string") private Map> mapMapOfString = null; - - /** + + + /** * Gets or Sets inner */ public enum InnerEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"); private String value; @@ -46,8 +48,9 @@ public enum InnerEnum { InnerEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -56,8 +59,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static InnerEnum fromValue(String text) { for (InnerEnum b : InnerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -66,65 +70,78 @@ public static InnerEnum fromValue(String text) { } return null; } + } - + @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; - + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { this.mapMapOfString = new HashMap<>(); } + this.mapMapOfString.put(key, mapMapOfStringItem); return this; } - - /** - * Get mapMapOfString - * @return mapMapOfString + /** + * Get mapMapOfString + * @return mapMapOfString **/ + + + + @Valid - @ApiModelProperty(value = "") + + + + +@ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } - public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } - + public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; return this; } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { this.mapOfEnumString = new HashMap<>(); } + this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } - - /** - * Get mapOfEnumString - * @return mapOfEnumString + /** + * Get mapOfEnumString + * @return mapOfEnumString **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } - public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,8 +159,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -166,5 +182,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 01184029234..6dd0b777ffe 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -33,81 +33,101 @@ */ public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid = null; - + @JsonProperty("dateTime") private OffsetDateTime dateTime = null; - + @JsonProperty("map") private Map map = null; - + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ + + + + @Valid - @ApiModelProperty(value = "") + + +@ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ + + + + @Valid - @ApiModelProperty(value = "") + + +@ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; return this; } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { this.map = new HashMap<>(); } + this.map.put(key, mapItem); return this; } - - /** - * Get map - * @return map + /** + * Get map + * @return map **/ + + + + @Valid - @ApiModelProperty(value = "") + + + + +@ApiModelProperty(value = "") public Map getMap() { return map; } - public void setMap(Map map) { this.map = map; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -126,8 +146,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(uuid, dateTime, map); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -151,5 +170,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 89ed29eca5d..7c9a45eb198 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 @@ -24,53 +24,62 @@ /** * Model for testing model name starting with number - */ -@ApiModel(description = "Model for testing model name starting with number") + */@ApiModel(description = "Model for testing model name starting with number") public class Model200Response { + @JsonProperty("name") private Integer name = null; - + @JsonProperty("class") private String propertyClass = null; - + public Model200Response name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - + public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -88,8 +97,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -112,5 +120,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelApiResponse.java index acfb194d9d7..fbf2dccdac3 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -27,70 +27,85 @@ */ public class ModelApiResponse { + @JsonProperty("code") private Integer code = null; - + @JsonProperty("type") private String type = null; - + @JsonProperty("message") private String message = null; - + public ModelApiResponse code(Integer code) { this.code = code; return this; } - /** - * Get code - * @return code + + /** + * Get code + * @return code **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Integer getCode() { return code; } - public void setCode(Integer code) { this.code = code; } - + public ModelApiResponse type(String type) { this.type = type; return this; } - /** - * Get type - * @return type + + /** + * Get type + * @return type **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getType() { return type; } - public void setType(String type) { this.type = type; } - + public ModelApiResponse message(String message) { this.message = message; return this; } - /** - * Get message - * @return message + + /** + * Get message + * @return message **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -109,8 +124,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(code, type, message); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -134,5 +148,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelReturn.java index d372354eb7e..e0e87169e69 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelReturn.java @@ -24,32 +24,36 @@ /** * Model for testing reserved words - */ -@ApiModel(description = "Model for testing reserved words") + */@ApiModel(description = "Model for testing reserved words") public class ModelReturn { + @JsonProperty("return") private Integer _return = null; - + public ModelReturn _return(Integer _return) { this._return = _return; return this; } - /** - * Get _return - * @return _return + + /** + * Get _return + * @return _return **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Integer getReturn() { return _return; } - public void setReturn(Integer _return) { this._return = _return; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -66,8 +70,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(_return); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,5 +92,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 c09048cce39..b73ebb07219 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 @@ -24,78 +24,100 @@ /** * Model for testing model name same as property name - */ -@ApiModel(description = "Model for testing model name same as property name") + */@ApiModel(description = "Model for testing model name same as property name") public class Name { + @JsonProperty("name") private Integer name = null; - + @JsonProperty("snake_case") private Integer snakeCase = null; - + @JsonProperty("property") private String property = null; - + @JsonProperty("123Number") private Integer _123Number = null; - + public Name name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ + @NotNull - @ApiModelProperty(required = true, value = "") + + + + + +@ApiModelProperty(required = true, value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - - /** - * Get snakeCase - * @return snakeCase + + + /** + * Get snakeCase + * @return snakeCase **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } - + public Name property(String property) { this.property = property; return this; } - /** - * Get property - * @return property + + /** + * Get property + * @return property **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getProperty() { return property; } - public void setProperty(String property) { this.property = property; } - - /** - * Get _123Number - * @return _123Number + + + /** + * Get _123Number + * @return _123Number **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -115,8 +137,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, snakeCase, property, _123Number); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -141,5 +162,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/NumberOnly.java index 91ab4497dc2..f8717b6c481 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/NumberOnly.java @@ -28,29 +28,35 @@ */ public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber = null; - + public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; return this; } - /** - * Get justNumber - * @return justNumber + + /** + * Get justNumber + * @return justNumber **/ + + + + @Valid - @ApiModelProperty(value = "") + + +@ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } - public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,8 +73,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -90,5 +95,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java index 752a57cbde8..7c06a656a94 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java @@ -28,26 +28,26 @@ */ public class Order { + @JsonProperty("id") private Long id = null; - + @JsonProperty("petId") private Long petId = null; - + @JsonProperty("quantity") private Integer quantity = null; - + @JsonProperty("shipDate") private OffsetDateTime shipDate = null; - - /** + + /** * Order Status */ public enum StatusEnum { - PLACED("placed"), + PLACED("placed"), APPROVED("approved"), - DELIVERED("delivered"); private String value; @@ -55,8 +55,9 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -65,8 +66,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -75,124 +77,156 @@ public static StatusEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("status") private StatusEnum status = null; - + @JsonProperty("complete") private Boolean complete = false; - + public Order id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Order petId(Long petId) { this.petId = petId; return this; } - /** - * Get petId - * @return petId + + /** + * Get petId + * @return petId **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Long getPetId() { return petId; } - public void setPetId(Long petId) { this.petId = petId; } - + public Order quantity(Integer quantity) { this.quantity = quantity; return this; } - /** - * Get quantity - * @return quantity + + /** + * Get quantity + * @return quantity **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } - public void setQuantity(Integer quantity) { this.quantity = quantity; } - + public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; return this; } - /** - * Get shipDate - * @return shipDate + + /** + * Get shipDate + * @return shipDate **/ + + + + @Valid - @ApiModelProperty(value = "") + + +@ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } - public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } - + public Order status(StatusEnum status) { this.status = status; return this; } - /** - * Order Status - * @return status + + /** + * Order Status + * @return status **/ - @ApiModelProperty(value = "Order Status") + + + + + +@ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - + public Order complete(Boolean complete) { this.complete = complete; return this; } - /** - * Get complete - * @return complete + + /** + * Get complete + * @return complete **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Boolean isComplete() { return complete; } - public void setComplete(Boolean complete) { this.complete = complete; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -214,8 +248,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -242,5 +275,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterComposite.java index 5b0e216eaa2..b75541bc56f 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterComposite.java @@ -28,71 +28,87 @@ */ public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber = null; - + @JsonProperty("my_string") private String myString = null; - + @JsonProperty("my_boolean") private Boolean myBoolean = null; - + public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; return this; } - /** - * Get myNumber - * @return myNumber + + /** + * Get myNumber + * @return myNumber **/ + + + + @Valid - @ApiModelProperty(value = "") + + +@ApiModelProperty(value = "") public BigDecimal getMyNumber() { return myNumber; } - public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } - + public OuterComposite myString(String myString) { this.myString = myString; return this; } - /** - * Get myString - * @return myString + + /** + * Get myString + * @return myString **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getMyString() { return myString; } - public void setMyString(String myString) { this.myString = myString; } - + public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; return this; } - /** - * Get myBoolean - * @return myBoolean + + /** + * Get myBoolean + * @return myBoolean **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Boolean getMyBoolean() { return myBoolean; } - public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -111,8 +127,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(myNumber, myString, myBoolean); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -136,5 +151,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterEnum.java index 778c8dca14a..3390d473c7b 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterEnum.java @@ -13,16 +13,17 @@ package io.swagger.client.model; -import java.util.Objects; -import javax.validation.constraints.*; -import javax.validation.Valid; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + + /** * Gets or Sets OuterEnum */ + public enum OuterEnum { PLACED("placed"), @@ -37,7 +38,9 @@ public enum OuterEnum { this.value = value; } + @JsonValue + public String getValue() { return value; } @@ -47,7 +50,9 @@ public String toString() { return String.valueOf(value); } + @JsonCreator + public static OuterEnum fromValue(String text) { for (OuterEnum b : OuterEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -56,5 +61,8 @@ public static OuterEnum fromValue(String text) { } return null; } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java index 653a9765a66..3215fe21ab7 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java @@ -31,29 +31,29 @@ */ public class Pet { + @JsonProperty("id") private Long id = null; - + @JsonProperty("category") private Category category = null; - + @JsonProperty("name") private String name = null; - + @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); - + @JsonProperty("tags") private List tags = null; - - /** + + /** * pet status in the store */ public enum StatusEnum { - AVAILABLE("available"), + AVAILABLE("available"), PENDING("pending"), - SOLD("sold"); private String value; @@ -61,8 +61,9 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -71,8 +72,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -81,137 +83,175 @@ public static StatusEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("status") private StatusEnum status = null; - + public Pet id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Pet category(Category category) { this.category = category; return this; } - /** - * Get category - * @return category + + /** + * Get category + * @return category **/ + + + + @Valid - @ApiModelProperty(value = "") + + +@ApiModelProperty(value = "") public Category getCategory() { return category; } - public void setCategory(Category category) { this.category = category; } - + public Pet name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ + @NotNull - @ApiModelProperty(example = "doggie", required = true, value = "") + + + + + +@ApiModelProperty(example = "doggie", required = true, value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - + public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); return this; } - - /** - * Get photoUrls - * @return photoUrls + + /** + * Get photoUrls + * @return photoUrls **/ + @NotNull - @ApiModelProperty(required = true, value = "") + + + + + +@ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } - + public Pet tags(List tags) { this.tags = tags; return this; } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { this.tags = new ArrayList<>(); } + this.tags.add(tagsItem); return this; } - - /** - * Get tags - * @return tags + + /** + * Get tags + * @return tags **/ + + + + @Valid - @ApiModelProperty(value = "") + + + + +@ApiModelProperty(value = "") public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } - + public Pet status(StatusEnum status) { this.status = status; return this; } - /** - * pet status in the store - * @return status + + /** + * pet status in the store + * @return status **/ - @ApiModelProperty(value = "pet status in the store") + + + + + +@ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -233,8 +273,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -261,5 +300,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index dc2373a365d..03baf3d4a12 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -27,40 +27,51 @@ */ public class ReadOnlyFirst { + @JsonProperty("bar") private String bar = null; - + @JsonProperty("baz") private String baz = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getBar() { return bar; } - + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; } - /** - * Get baz - * @return baz + + /** + * Get baz + * @return baz **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getBaz() { return baz; } - public void setBaz(String baz) { this.baz = baz; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -78,8 +89,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, baz); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -102,5 +112,8 @@ private String toIndentedString(java.lang.Object o) { 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 f01a06d4c78..55e4f4ad11e 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 @@ -27,28 +27,33 @@ */ public class SpecialModelName { - @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + @JsonProperty("$special[property.name]") + private Long $specialPropertyName = null; + + 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 void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; - } +@ApiModelProperty(value = "") + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -57,22 +62,21 @@ public boolean equals(java.lang.Object o) { 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); } - - + @Override public String toString() { 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(); } @@ -88,5 +92,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Tag.java index 71ff1bfcf67..850d97a3f27 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Tag.java @@ -27,49 +27,59 @@ */ public class Tag { + @JsonProperty("id") private Long id = null; - + @JsonProperty("name") private String name = null; - + public Tag id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Tag name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -87,8 +97,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -111,5 +120,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/User.java index 82c6be534ec..089aaa71b74 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/User.java @@ -27,175 +27,215 @@ */ public class User { + @JsonProperty("id") private Long id = null; - + @JsonProperty("username") private String username = null; - + @JsonProperty("firstName") private String firstName = null; - + @JsonProperty("lastName") private String lastName = null; - + @JsonProperty("email") private String email = null; - + @JsonProperty("password") private String password = null; - + @JsonProperty("phone") private String phone = null; - + @JsonProperty("userStatus") private Integer userStatus = null; - + public User id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public User username(String username) { this.username = username; return this; } - /** - * Get username - * @return username + + /** + * Get username + * @return username **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getUsername() { return username; } - public void setUsername(String username) { this.username = username; } - + public User firstName(String firstName) { this.firstName = firstName; return this; } - /** - * Get firstName - * @return firstName + + /** + * Get firstName + * @return firstName **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getFirstName() { return firstName; } - public void setFirstName(String firstName) { this.firstName = firstName; } - + public User lastName(String lastName) { this.lastName = lastName; return this; } - /** - * Get lastName - * @return lastName + + /** + * Get lastName + * @return lastName **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getLastName() { return lastName; } - public void setLastName(String lastName) { this.lastName = lastName; } - + public User email(String email) { this.email = email; return this; } - /** - * Get email - * @return email + + /** + * Get email + * @return email **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getEmail() { return email; } - public void setEmail(String email) { this.email = email; } - + public User password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - + public User phone(String phone) { this.phone = phone; return this; } - /** - * Get phone - * @return phone + + /** + * Get phone + * @return phone **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getPhone() { return phone; } - public void setPhone(String phone) { this.phone = phone; } - + public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; } - /** - * User Status - * @return userStatus + + /** + * User Status + * @return userStatus **/ - @ApiModelProperty(value = "User Status") + + + + + +@ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } - public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -219,8 +259,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -249,5 +288,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..6fdc3702e80 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 @@ -2,14 +2,17 @@ import io.swagger.client.ApiClient; import io.swagger.client.model.Client; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for AnotherFakeApi */ @@ -22,6 +25,8 @@ public void setup() { api = new ApiClient().createService(AnotherFakeApi.class); } + + /** * To test special tags * @@ -29,9 +34,13 @@ public void setup() { */ @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..559492405ac 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,16 +3,18 @@ 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 io.swagger.client.model.OuterComposite; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for FakeApi */ @@ -26,15 +28,78 @@ public void setup() { } + /** - * To test \"client\" model + * + * + * Test serialization of outer boolean types + */ + @Test + public void fakeOuterBooleanSerializeTest() { + + Boolean body = null; + + // Boolean response = api.fakeOuterBooleanSerialize(body); + + // 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 + } + + /** + * To test \"client\" model + * + * To test \"client\" model */ @Test public void testClientModelTest() { - Client body = null; - // Client response = api.testClientModel(body); + + Client client = null; + + // Client response = api.testClientModel(client); // TODO: test validations } @@ -46,21 +111,10 @@ public void testClientModelTest() { */ @Test public void testEndpointParametersTest() { - BigDecimal number = null; - Double _double = null; - String patternWithoutDelimiter = null; - byte[] _byte = null; - Integer integer = null; - Integer int32 = null; - Long int64 = null; - Float _float = null; - String string = null; - byte[] binary = null; - LocalDate date = null; - DateTime 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); + + Object body = null; + + // Void response = api.testEndpointParameters(body); // TODO: test validations } @@ -68,21 +122,57 @@ public void testEndpointParametersTest() { /** * To test enum parameters * - * + * To test enum parameters */ @Test public void testEnumParametersTest() { - List enumFormStringArray = null; - String enumFormString = null; + + Object body = null; + List enumHeaderStringArray = null; + String enumHeaderString = null; + List enumQueryStringArray = null; + String enumQueryString = null; - BigDecimal enumQueryInteger = null; - Double enumQueryDouble = null; - // Void response = api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + + Integer enumQueryInteger = null; + + // Void response = api.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); // TODO: test validations } + /** + * test inline additionalProperties + * + * + */ + @Test + public void testInlineAdditionalPropertiesTest() { + + Map body = null; + + // Void response = api.testInlineAdditionalProperties(body); + + // TODO: test validations + } + + /** + * test json serialization of form data + * + * + */ + @Test + public void testJsonFormDataTest() { + + Object body = null; + + // Void response = api.testJsonFormData(body); + + // 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..ab29f7ce6af 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 @@ -2,14 +2,17 @@ import io.swagger.client.ApiClient; import io.swagger.client.model.Client; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for FakeClassnameTags123Api */ @@ -23,6 +26,7 @@ public void setup() { } + /** * To test class name in snake case * @@ -30,10 +34,13 @@ public void setup() { */ @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..7b467b0b508 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 @@ -1,17 +1,19 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; -import java.io.File; 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.HashMap; import java.util.List; import java.util.Map; + /** * API tests for PetApi */ @@ -25,6 +27,7 @@ public void setup() { } + /** * Add a new pet to the store * @@ -32,8 +35,10 @@ public void setup() { */ @Test public void addPetTest() { - Pet body = null; - // Void response = api.addPet(body); + + Pet pet = null; + + // Void response = api.addPet(pet); // TODO: test validations } @@ -45,8 +50,11 @@ public void addPetTest() { */ @Test public void deletePetTest() { - Long petId = null; + + Integer petId = null; + String apiKey = null; + // Void response = api.deletePet(petId, apiKey); // TODO: test validations @@ -59,7 +67,9 @@ public void deletePetTest() { */ @Test public void findPetsByStatusTest() { + List status = null; + // List response = api.findPetsByStatus(status); // TODO: test validations @@ -72,7 +82,9 @@ public void findPetsByStatusTest() { */ @Test public void findPetsByTagsTest() { + List tags = null; + // List response = api.findPetsByTags(tags); // TODO: test validations @@ -85,7 +97,9 @@ public void findPetsByTagsTest() { */ @Test public void getPetByIdTest() { - Long petId = null; + + Integer petId = null; + // Pet response = api.getPetById(petId); // TODO: test validations @@ -98,8 +112,10 @@ public void getPetByIdTest() { */ @Test public void updatePetTest() { - Pet body = null; - // Void response = api.updatePet(body); + + Pet pet = null; + + // Void response = api.updatePet(pet); // TODO: test validations } @@ -111,10 +127,12 @@ public void updatePetTest() { */ @Test public void updatePetWithFormTest() { - Long petId = null; - String name = null; - String status = null; - // Void response = api.updatePetWithForm(petId, name, status); + + Integer petId = null; + + Object body = null; + + // Void response = api.updatePetWithForm(petId, body); // TODO: test validations } @@ -126,12 +144,15 @@ public void updatePetWithFormTest() { */ @Test public void uploadFileTest() { - Long petId = null; - String additionalMetadata = null; - File file = null; - // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + + Integer petId = null; + + Object body = null; + + // ModelApiResponse response = api.uploadFile(petId, body); // 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..f59141e4eed 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 @@ -2,14 +2,17 @@ import io.swagger.client.ApiClient; import io.swagger.client.model.Order; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for StoreApi */ @@ -23,6 +26,7 @@ public void setup() { } + /** * Delete purchase order by ID * @@ -30,7 +34,9 @@ public void setup() { */ @Test public void deleteOrderTest() { + String orderId = null; + // Void response = api.deleteOrder(orderId); // TODO: test validations @@ -43,6 +49,7 @@ public void deleteOrderTest() { */ @Test public void getInventoryTest() { + // Map response = api.getInventory(); // TODO: test validations @@ -55,7 +62,9 @@ public void getInventoryTest() { */ @Test public void getOrderByIdTest() { - Long orderId = null; + + Integer orderId = null; + // Order response = api.getOrderById(orderId); // TODO: test validations @@ -68,10 +77,13 @@ public void getOrderByIdTest() { */ @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..2f011d503a5 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 @@ -2,14 +2,17 @@ import io.swagger.client.ApiClient; 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; + /** * API tests for UserApi */ @@ -23,6 +26,7 @@ public void setup() { } + /** * Create user * @@ -30,8 +34,10 @@ public void setup() { */ @Test public void createUserTest() { - User body = null; - // Void response = api.createUser(body); + + User user = null; + + // Void response = api.createUser(user); // TODO: test validations } @@ -43,7 +49,9 @@ public void createUserTest() { */ @Test public void createUsersWithArrayInputTest() { + List body = null; + // Void response = api.createUsersWithArrayInput(body); // TODO: test validations @@ -56,7 +64,9 @@ public void createUsersWithArrayInputTest() { */ @Test public void createUsersWithListInputTest() { + List body = null; + // Void response = api.createUsersWithListInput(body); // TODO: test validations @@ -69,7 +79,9 @@ public void createUsersWithListInputTest() { */ @Test public void deleteUserTest() { + String username = null; + // Void response = api.deleteUser(username); // TODO: test validations @@ -82,7 +94,9 @@ public void deleteUserTest() { */ @Test public void getUserByNameTest() { + String username = null; + // User response = api.getUserByName(username); // TODO: test validations @@ -95,8 +109,11 @@ public void getUserByNameTest() { */ @Test public void loginUserTest() { + String username = null; + String password = null; + // String response = api.loginUser(username, password); // TODO: test validations @@ -109,6 +126,7 @@ public void loginUserTest() { */ @Test public void logoutUserTest() { + // Void response = api.logoutUser(); // TODO: test validations @@ -121,11 +139,15 @@ public void logoutUserTest() { */ @Test public void updateUserTest() { + + User user = null; + String username = null; - User body = null; - // Void response = api.updateUser(username, body); + + // Void response = api.updateUser(user, username); // TODO: test validations } + } diff --git a/samples/client/petstore/java/retrofit2-play25/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit2-play25/.swagger-codegen/VERSION index f9f7450d135..096bf47efe3 100644 --- a/samples/client/petstore/java/retrofit2-play25/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/retrofit2-play25/.swagger-codegen/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/retrofit2-play25/build.gradle b/samples/client/petstore/java/retrofit2-play25/build.gradle index 949928aa0c7..aeee8829d20 100644 --- a/samples/client/petstore/java/retrofit2-play25/build.gradle +++ b/samples/client/petstore/java/retrofit2-play25/build.gradle @@ -32,8 +32,11 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 + + } // Rename the aar correctly @@ -94,27 +97,46 @@ if(hasProperty('target') && target == 'android') { } ext { - oltu_version = "1.0.1" + oltu_version = "1.0.2" retrofit_version = "2.3.0" + + + jackson_version = "2.7.8" play_version = "2.5.14" + + swagger_annotations_version = "1.5.15" junit_version = "4.12" + + + + threetenbp_version = "1.3.5" + + json_fire_version = "1.8.0" } dependencies { compile "com.squareup.retrofit2:retrofit:$retrofit_version" compile "com.squareup.retrofit2:converter-scalars:$retrofit_version" compile "com.squareup.retrofit2:converter-gson:$retrofit_version" + + compile "io.swagger:swagger-annotations:$swagger_annotations_version" compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" + compile "io.gsonfire:gson-fire:$json_fire_version" + + compile "org.threeten:threetenbp:$threetenbp_version" + + compile "com.typesafe.play:play-java-ws_2.11:$play_version" compile "com.squareup.retrofit2:converter-jackson:$retrofit_version" compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + testCompile "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/retrofit2-play25/build.sbt b/samples/client/petstore/java/retrofit2-play25/build.sbt index c1a0220619c..1bd6af3daaf 100644 --- a/samples/client/petstore/java/retrofit2-play25/build.sbt +++ b/samples/client/petstore/java/retrofit2-play25/build.sbt @@ -11,14 +11,26 @@ lazy val root = (project in file(".")). libraryDependencies ++= Seq( "com.squareup.retrofit2" % "retrofit" % "2.3.0" % "compile", "com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile", + + + + "com.typesafe.play" % "play-java-ws_2.11" % "2.5.15" % "compile", "com.fasterxml.jackson.core" % "jackson-core" % "2.7.8" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.7.8" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.7.8" % "compile", + "com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile", + + + "io.swagger" % "swagger-annotations" % "1.5.15" % "compile", - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2" % "compile", + + "org.threeten" % "threetenbp" % "1.3.5" % "compile", + + "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" ) diff --git a/samples/client/petstore/java/retrofit2-play25/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/retrofit2-play25/docs/AdditionalPropertiesClass.md index 0437c4dd8cc..b37862da7cf 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/AdditionalPropertiesClass.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/Animal.md b/samples/client/petstore/java/retrofit2-play25/docs/Animal.md index b3f325c3524..346caaf63f4 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/Animal.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/Animal.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/AnimalFarm.md b/samples/client/petstore/java/retrofit2-play25/docs/AnimalFarm.md deleted file mode 100644 index c7c7f1ddcce..00000000000 --- a/samples/client/petstore/java/retrofit2-play25/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ - -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - diff --git a/samples/client/petstore/java/retrofit2-play25/docs/AnotherFakeApi.md b/samples/client/petstore/java/retrofit2-play25/docs/AnotherFakeApi.md index bcc1a3a45ce..792799b51e8 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/AnotherFakeApi.md @@ -7,9 +7,11 @@ Method | HTTP request | Description [**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** another-fake/dummy | To test special tags + + # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -22,10 +24,13 @@ To test special tags //import io.swagger.client.api.AnotherFakeApi; + AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +42,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -52,3 +58,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/retrofit2-play25/docs/ArrayOfArrayOfNumberOnly.md index 77292549927..3671a5e9190 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/ArrayOfArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/retrofit2-play25/docs/ArrayOfNumberOnly.md index e8cc4cd36dc..30b9b6648f4 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/ArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/ArrayTest.md b/samples/client/petstore/java/retrofit2-play25/docs/ArrayTest.md index 9feee16427f..4ab76343030 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/ArrayTest.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/ArrayTest.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/Capitalization.md b/samples/client/petstore/java/retrofit2-play25/docs/Capitalization.md index 0f3064c1996..9af7864f97e 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/Capitalization.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/Capitalization.md @@ -13,3 +13,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/Cat.md b/samples/client/petstore/java/retrofit2-play25/docs/Cat.md index 6e9f71ce7dd..5e408344021 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/Cat.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/Cat.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **declawed** | **Boolean** | | [optional] + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/Category.md b/samples/client/petstore/java/retrofit2-play25/docs/Category.md index e2df0803278..deb5a3e2a52 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/Category.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/Category.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/ClassModel.md b/samples/client/petstore/java/retrofit2-play25/docs/ClassModel.md index 64f880c8786..49c281cc0ed 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/ClassModel.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/ClassModel.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/Client.md b/samples/client/petstore/java/retrofit2-play25/docs/Client.md index 5c490ea166c..52b2f72c79c 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/Client.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/Client.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/Dog.md b/samples/client/petstore/java/retrofit2-play25/docs/Dog.md index ac7cea323ff..00e6446e9f5 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/Dog.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/Dog.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **breed** | **String** | | [optional] + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/EnumArrays.md b/samples/client/petstore/java/retrofit2-play25/docs/EnumArrays.md index 4dddc0bfd27..939a0e69587 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/EnumArrays.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/EnumArrays.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] + ## Enum: JustSymbolEnum Name | Value @@ -20,8 +21,6 @@ DOLLAR | "$" ## Enum: List<ArrayEnumEnum> Name | Value ---- | ----- -FISH | "fish" -CRAB | "crab" diff --git a/samples/client/petstore/java/retrofit2-play25/docs/EnumTest.md b/samples/client/petstore/java/retrofit2-play25/docs/EnumTest.md index 08fee344882..9722c621962 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/EnumTest.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] + ## Enum: EnumStringEnum 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 1467a2943d6..6d1d77bdf10 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md @@ -11,9 +11,12 @@ Method | HTTP request | Description [**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) @@ -29,8 +32,11 @@ Test serialization of outer boolean types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body + +Boolean body = ; // Boolean | Input boolean as post body + try { Boolean result = apiInstance.fakeOuterBooleanSerialize(body); System.out.println(result); @@ -46,6 +52,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + ### Return type **Boolean** @@ -56,12 +63,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outercomposite) @@ -74,10 +82,13 @@ Test serialization of object with outer number type //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body + +OuterComposite 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 +100,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outercomposite** | [**OuterComposite**](.md)| Input composite as post body | [optional] + ### Return type @@ -101,8 +113,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterNumberSerialize** @@ -119,8 +132,11 @@ Test serialization of outer number types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body + +BigDecimal body = ; // BigDecimal | Input number as post body + try { BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); System.out.println(result); @@ -136,6 +152,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + ### Return type [**BigDecimal**](BigDecimal.md) @@ -146,8 +163,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterStringSerialize** @@ -164,8 +182,11 @@ Test serialization of outer string types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String body = "body_example"; // String | Input string as post body + +String body = ; // String | Input string as post body + try { String result = apiInstance.fakeOuterStringSerialize(body); System.out.println(result); @@ -181,6 +202,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**String**](String.md)| Input string as post body | [optional] + ### Return type **String** @@ -191,12 +213,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -209,10 +232,13 @@ To test \"client\" model //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +250,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -239,9 +266,10 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + # **testEndpointParameters** -> Void testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) +> Void testEndpointParameters(body) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -250,36 +278,17 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### 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.FakeApi; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure HTTP basic authorization: http_basic_test -HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); -http_basic_test.setUsername("YOUR USERNAME"); -http_basic_test.setPassword("YOUR PASSWORD"); 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 -Integer integer = 56; // Integer | None -Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None -Float _float = 3.4F; // Float | None -String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None -LocalDate date = new LocalDate(); // LocalDate | None -OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None -String password = "password_example"; // String | None -String paramCallback = "paramCallback_example"; // String | None + +Object body = ; // Object | + try { - Void result = apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + Void result = apiInstance.testEndpointParameters(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEndpointParameters"); @@ -291,20 +300,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **BigDecimal**| None | - **_double** | **Double**| None | - **patternWithoutDelimiter** | **String**| None | - **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] - **int64** | **Long**| None | [optional] - **_float** | **Float**| None | [optional] - **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] - **date** | **LocalDate**| None | [optional] - **dateTime** | **OffsetDateTime**| None | [optional] - **password** | **String**| None | [optional] - **paramCallback** | **String**| None | [optional] + **body** | [**Object**](Object.md)| | + ### Return type @@ -317,11 +314,12 @@ Name | Type | Description | Notes ### 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 + - **Accept**: Not defined + # **testEnumParameters** -> Void testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> Void testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger) To test enum parameters @@ -334,17 +332,23 @@ To test enum parameters //import io.swagger.client.api.FakeApi; + 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) + +Object body = ; // Object | + List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) -String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + +String enumHeaderString = Arrays.asList("enumHeaderString_example"); // 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) + +String enumQueryString = Arrays.asList("enumQueryString_example"); // String | Query parameter enum test (string) + +Integer enumQueryInteger = Arrays.asList(56); // Integer | Query parameter enum test (double) + try { - Void result = apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + Void result = apiInstance.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); @@ -356,14 +360,13 @@ 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] + **body** | [**Object**](Object.md)| | [optional] + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: ] + **enumHeaderString** | [**String**](.md)| Header parameter enum test (string) | [optional] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: ] + **enumQueryString** | [**String**](.md)| Query parameter enum test (string) | [optional] + **enumQueryInteger** | [**Integer**](.md)| Query parameter enum test (double) | [optional] + ### Return type @@ -376,16 +379,63 @@ No authorization required ### HTTP request headers - **Content-Type**: */* - - **Accept**: */* + - **Accept**: Not defined + + + +# **testInlineAdditionalProperties** +> Void testInlineAdditionalProperties(body) + +test inline additionalProperties + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + + +FakeApi apiInstance = new FakeApi(); + +Map body = ; // Map | request body + +try { + Void result = apiInstance.testInlineAdditionalProperties(body); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Map<String, String>**](Map.md)| request body | + + +### Return type + +[**Void**](.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + # **testJsonFormData** -> Void testJsonFormData(param, param2) +> Void testJsonFormData(body) test json serialization of form data - - ### Example ```java // Import classes: @@ -393,11 +443,13 @@ test json serialization of form data //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String param = "param_example"; // String | field1 -String param2 = "param2_example"; // String | field2 + +Object body = ; // Object | + try { - Void result = apiInstance.testJsonFormData(param, param2); + Void result = apiInstance.testJsonFormData(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testJsonFormData"); @@ -409,8 +461,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **String**| field1 | - **param2** | **String**| field2 | + **body** | [**Object**](Object.md)| | + ### Return type @@ -425,3 +477,5 @@ No authorization required - **Content-Type**: application/json - **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..2336289e187 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/FakeClassnameTags123Api.md @@ -7,33 +7,28 @@ Method | HTTP request | Description [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** fake_classname_test | To test class name in snake case + + # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case ### 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.FakeClassnameTags123Api; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure API key authorization: api_key_query -ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); -api_key_query.setApiKey("YOUR API KEY"); -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model + +Client 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 +40,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -60,3 +56,5 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/FormatTest.md b/samples/client/petstore/java/retrofit2-play25/docs/FormatTest.md index c7a3acb3cb7..bc11b93cb26 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/FormatTest.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/FormatTest.md @@ -11,8 +11,8 @@ Name | Type | Description | Notes **_float** | **Float** | | [optional] **_double** | **Double** | | [optional] **string** | **String** | | [optional] -**_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**_byte** | **String** | | +**binary** | **String** | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] @@ -20,3 +20,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/retrofit2-play25/docs/HasOnlyReadOnly.md index c1d0aac5672..5564ddcf28a 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/HasOnlyReadOnly.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/MapTest.md b/samples/client/petstore/java/retrofit2-play25/docs/MapTest.md index 714a97a40d9..74a6fe8ae70 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/MapTest.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/MapTest.md @@ -8,12 +8,11 @@ Name | Type | Description | Notes **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] + ## Enum: Map<String, InnerEnum> Name | Value ---- | ----- -UPPER | "UPPER" -LOWER | "lower" diff --git a/samples/client/petstore/java/retrofit2-play25/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/retrofit2-play25/docs/MixedPropertiesAndAdditionalPropertiesClass.md index b12e2cd70e6..4507481b5a9 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/Model200Response.md b/samples/client/petstore/java/retrofit2-play25/docs/Model200Response.md index 5b3a9a0e46d..8d2cc50bb83 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/Model200Response.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/Model200Response.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/ModelApiResponse.md b/samples/client/petstore/java/retrofit2-play25/docs/ModelApiResponse.md index 3eec8686cc9..06052b202f1 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/ModelApiResponse.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/ModelApiResponse.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/ModelReturn.md b/samples/client/petstore/java/retrofit2-play25/docs/ModelReturn.md index a679b04953e..a7845ba254b 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/ModelReturn.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/ModelReturn.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/Name.md b/samples/client/petstore/java/retrofit2-play25/docs/Name.md index ce2fb4dee50..a8d6fec9714 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/Name.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/Name.md @@ -11,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/NumberOnly.md b/samples/client/petstore/java/retrofit2-play25/docs/NumberOnly.md index a3feac7fadc..adfb36a95bb 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/NumberOnly.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/NumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/Order.md b/samples/client/petstore/java/retrofit2-play25/docs/Order.md index 268c617d1ff..7e4beff6df1 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/Order.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/Order.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/retrofit2-play25/docs/OuterComposite.md b/samples/client/petstore/java/retrofit2-play25/docs/OuterComposite.md index 3f5a633c998..1963c7a0f73 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/OuterComposite.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/OuterComposite.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/Pet.md b/samples/client/petstore/java/retrofit2-play25/docs/Pet.md index 5b63109ef92..1492195a58d 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/Pet.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/Pet.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md b/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md index ea3c05ad412..c5748bb7cd3 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md @@ -14,33 +14,28 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** pet/{petId}/uploadImage | uploads an image + + # **addPet** -> Void addPet(body) +> Void addPet(pet) 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 + +Pet pet = ; // Pet | Pet object that needs to be added to the store + try { - Void result = apiInstance.addPet(body); + Void result = apiInstance.addPet(pet); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); @@ -52,7 +47,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -65,7 +61,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **deletePet** @@ -73,26 +70,20 @@ Name | Type | Description | Notes 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 | + +Integer petId = Arrays.asList(56); // Integer | Pet id to delete + +String apiKey = Arrays.asList("apiKey_example"); // String | + try { Void result = apiInstance.deletePet(petId, apiKey); System.out.println(result); @@ -106,8 +97,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | - **apiKey** | **String**| | [optional] + **petId** | [**Integer**](.md)| Pet id to delete | + **apiKey** | [**String**](.md)| | [optional] + ### Return type @@ -120,7 +112,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **findPetsByStatus** @@ -133,20 +126,15 @@ 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); @@ -160,7 +148,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: ] + ### Return type @@ -175,6 +164,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **findPetsByTags** > List<Pet> findPetsByTags(tags) @@ -186,20 +176,15 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### 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); @@ -215,6 +200,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | + ### Return type [**List<Pet>**](Pet.md) @@ -228,6 +214,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **getPetById** > Pet getPetById(petId) @@ -239,22 +226,15 @@ 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to return + try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -268,7 +248,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to return | + **petId** | [**Integer**](.md)| ID of pet to return | + ### Return type @@ -283,33 +264,27 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **updatePet** -> Void updatePet(body) +> Void updatePet(pet) 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 + +Pet pet = ; // Pet | Pet object that needs to be added to the store + try { - Void result = apiInstance.updatePet(body); + Void result = apiInstance.updatePet(pet); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); @@ -321,7 +296,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -334,37 +310,31 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updatePetWithForm** -> Void updatePetWithForm(petId, name, status) +> Void updatePetWithForm(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet that needs to be updated + +Object body = ; // Object | + try { - Void result = apiInstance.updatePetWithForm(petId, name, status); + Void result = apiInstance.updatePetWithForm(petId, body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePetWithForm"); @@ -376,9 +346,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet that needs to be updated | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -391,37 +361,31 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **uploadFile** -> ModelApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to update + +Object body = ; // Object | + try { - ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); + ModelApiResponse result = apiInstance.uploadFile(petId, body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFile"); @@ -433,9 +397,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet to update | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -450,3 +414,5 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json + + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/ReadOnlyFirst.md b/samples/client/petstore/java/retrofit2-play25/docs/ReadOnlyFirst.md index 426b7cde95a..57655e5b49e 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/ReadOnlyFirst.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/SpecialModelName.md b/samples/client/petstore/java/retrofit2-play25/docs/SpecialModelName.md index c2c6117c552..f4259d2a73c 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/SpecialModelName.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/SpecialModelName.md @@ -4,7 +4,8 @@ ## 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 134f0c36578..35b66fd8485 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/StoreApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/StoreApi.md @@ -10,6 +10,8 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet + + # **deleteOrder** > Void deleteOrder(orderId) @@ -25,8 +27,11 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + +String orderId = Arrays.asList("orderId_example"); // String | ID of the order that needs to be deleted + try { Void result = apiInstance.deleteOrder(orderId); System.out.println(result); @@ -40,7 +45,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | + **orderId** | [**String**](.md)| ID of the order that needs to be deleted | + ### Return type @@ -53,7 +59,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getInventory** @@ -66,21 +73,13 @@ 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); @@ -93,6 +92,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type **Map<String, Integer>** @@ -106,6 +106,7 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json + # **getOrderById** > Order getOrderById(orderId) @@ -121,8 +122,11 @@ For valid response try integer IDs with value <= 5 or > 10. Other val //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched + +Integer orderId = Arrays.asList(56); // Integer | ID of pet that needs to be fetched + try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -136,7 +140,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | [**Integer**](.md)| ID of pet that needs to be fetched | + ### Return type @@ -151,14 +156,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -166,10 +170,13 @@ Place an order for a pet //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet + +Order 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"); @@ -181,7 +188,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](.md)| order placed for purchasing the pet | + ### Return type @@ -193,6 +201,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: */* - **Accept**: application/xml, application/json + + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/Tag.md b/samples/client/petstore/java/retrofit2-play25/docs/Tag.md index de6814b55d5..7a97d4c6812 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/Tag.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/Tag.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/User.md b/samples/client/petstore/java/retrofit2-play25/docs/User.md index 8b6753dd284..cf7f9ce1312 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/User.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/User.md @@ -15,3 +15,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/UserApi.md b/samples/client/petstore/java/retrofit2-play25/docs/UserApi.md index 40096ec05bc..619b98b9fa7 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/UserApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/UserApi.md @@ -14,9 +14,11 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** user/{username} | Updated user + + # **createUser** -> Void createUser(body) +> Void createUser(user) Create user @@ -29,10 +31,13 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object + +User user = ; // User | Created user object + try { - Void result = apiInstance.createUser(body); + Void result = apiInstance.createUser(user); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); @@ -44,7 +49,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](.md)| Created user object | + ### Return type @@ -56,8 +62,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithArrayInput** @@ -65,8 +72,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -74,8 +79,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { Void result = apiInstance.createUsersWithArrayInput(body); System.out.println(result); @@ -91,6 +99,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type [**Void**](.md) @@ -101,8 +110,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithListInput** @@ -110,8 +120,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -119,8 +127,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { Void result = apiInstance.createUsersWithListInput(body); System.out.println(result); @@ -136,6 +147,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type [**Void**](.md) @@ -146,8 +158,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **deleteUser** @@ -164,8 +177,11 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be deleted + +String username = Arrays.asList("username_example"); // String | The name that needs to be deleted + try { Void result = apiInstance.deleteUser(username); System.out.println(result); @@ -179,7 +195,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | + **username** | [**String**](.md)| The name that needs to be deleted | + ### Return type @@ -192,7 +209,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getUserByName** @@ -200,8 +218,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -209,8 +225,11 @@ Get user by user name //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. + +String username = Arrays.asList("username_example"); // String | The name that needs to be fetched. Use user1 for testing. + try { User result = apiInstance.getUserByName(username); System.out.println(result); @@ -224,7 +243,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + **username** | [**String**](.md)| The name that needs to be fetched. Use user1 for testing. | + ### Return type @@ -239,14 +259,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **loginUser** > String loginUser(username, password) Logs user into the system - - ### Example ```java // Import classes: @@ -254,9 +273,13 @@ Logs user into the system //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 + +String username = Arrays.asList("username_example"); // String | The user name for login + +String password = Arrays.asList("password_example"); // String | The password for login in clear text + try { String result = apiInstance.loginUser(username, password); System.out.println(result); @@ -270,8 +293,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | + **username** | [**String**](.md)| The user name for login | + **password** | [**String**](.md)| The password for login in clear text | + ### Return type @@ -286,14 +310,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **logoutUser** > Void logoutUser() Logs out current logged in user session - - ### Example ```java // Import classes: @@ -301,7 +324,9 @@ Logs out current logged in user session //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); + try { Void result = apiInstance.logoutUser(); System.out.println(result); @@ -314,6 +339,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type [**Void**](.md) @@ -325,11 +351,12 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updateUser** -> Void updateUser(username, body) +> Void updateUser(user, username) Updated user @@ -342,11 +369,15 @@ This can only be done by the logged in user. //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 + +User user = ; // User | Updated user object + +String username = Arrays.asList("username_example"); // String | name that need to be deleted + try { - Void result = apiInstance.updateUser(username, body); + Void result = apiInstance.updateUser(user, username); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); @@ -358,8 +389,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](.md)| Updated user object | + **username** | [**String**](.md)| name that need to be deleted | + ### Return type @@ -371,6 +403,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + + diff --git a/samples/client/petstore/java/retrofit2-play25/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/retrofit2-play25/gradle/wrapper/gradle-wrapper.jar index 2c6137b8789..e69de29bb2d 100644 Binary files a/samples/client/petstore/java/retrofit2-play25/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/retrofit2-play25/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/retrofit2-play25/pom.xml b/samples/client/petstore/java/retrofit2-play25/pom.xml index f8c24b3fb91..8eadf773691 100644 --- a/samples/client/petstore/java/retrofit2-play25/pom.xml +++ b/samples/client/petstore/java/retrofit2-play25/pom.xml @@ -194,12 +194,23 @@ org.apache.oltu.oauth2.client ${oltu-version} + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.threeten threetenbp ${threetenbp-version} + + + + com.squareup.retrofit2 @@ -226,12 +237,15 @@ jackson-datatype-jsr310 ${jackson-version} + com.typesafe.play play-java-ws_2.11 ${play-version} + + @@ -246,12 +260,23 @@ 1.8 ${java.version} ${java.version} + 1.8.0 1.5.15 + + + 2.7.8 2.5.15 + + 2.3.0 + + + + 1.3.5 - 1.0.1 + + 1.0.2 4.12 diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/Play25CallAdapterFactory.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/Play25CallAdapterFactory.java index a952d89bb5f..3f64cea1b74 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/Play25CallAdapterFactory.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/Play25CallAdapterFactory.java @@ -64,7 +64,7 @@ private CallAdapter> createAdapter(ParameterizedType retur } /** - * Adapter that coverts values returned by API interface into CompletionStage + * Adpater that coverts values returned by API interface into CompletionStage */ private static final class ValueAdapter implements CallAdapter> { 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..1d3b03783ea 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 @@ -11,27 +11,43 @@ import io.swagger.client.model.Client; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import java.util.concurrent.*; import retrofit2.Response; + 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({ "Content-Type:application/json" }) + + + @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 879c6ebe201..b722701a97d 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 @@ -11,132 +11,249 @@ 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 java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import java.util.concurrent.*; import retrofit2.Response; + public interface FakeApi { + /** * * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Call<Boolean> */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("fake/outer/boolean") CompletionStage> fakeOuterBooleanSerialize( @retrofit2.http.Body Boolean body ); + /** * * 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> */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("fake/outer/composite") CompletionStage> fakeOuterCompositeSerialize( - @retrofit2.http.Body OuterComposite body + @retrofit2.http.Body OuterComposite outercomposite ); + /** * * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return Call<BigDecimal> */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("fake/outer/number") CompletionStage> fakeOuterNumberSerialize( @retrofit2.http.Body BigDecimal body ); + /** * * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return Call<String> */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("fake/outer/string") CompletionStage> fakeOuterStringSerialize( @retrofit2.http.Body String body ); + /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + + * @param client client model (required) + * @return Call<Client> */ + + + + @Headers({ "Content-Type:application/json" }) + + + @PATCH("fake") CompletionStage> testClientModel( - @retrofit2.http.Body Client body + @retrofit2.http.Body Client client ); + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) + + * @param body (required) + * @return Call<Void> */ - @retrofit2.http.FormUrlEncoded + + + + + @Headers({ + "Content-Type:application/json; charset=utf-8" + }) + + + + + @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.Body Object body ); + /** * 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 body (optional) + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + + * @param enumHeaderString Header parameter enum test (string) (optional) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + + * @param enumQueryString Query parameter enum test (string) (optional) + * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) + * @return Call<Void> */ - @retrofit2.http.FormUrlEncoded + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @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.Body Object body, @retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Path("enum_query_string_array") List enumQueryStringArray, @retrofit2.http.Path("enum_query_string") String enumQueryString, @retrofit2.http.Path("enum_query_integer") Integer enumQueryInteger + ); + + + /** + * test inline additionalProperties + * + + * @param body request body (required) + + * @return Call<Void> + */ + + + + + @Headers({ + "Content-Type:application/json" + }) + + + + @POST("fake/inline-additionalProperties") + CompletionStage> testInlineAdditionalProperties( + @retrofit2.http.Body Map body ); + /** * test json serialization of form data * - * @param param field1 (required) - * @param param2 field2 (required) + + * @param body (required) + * @return Call<Void> */ - @retrofit2.http.FormUrlEncoded + + + + + @Headers({ + "Content-Type:application/json" + }) + + + @GET("fake/jsonFormData") CompletionStage> testJsonFormData( - @retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2 + @retrofit2.http.Body Object body ); + } + 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..9438026cf1d 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 @@ -11,27 +11,43 @@ import io.swagger.client.model.Client; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import java.util.concurrent.*; import retrofit2.Response; + public interface FakeClassnameTags123Api { + /** * To test class name in snake case * - * @param body client model (required) + + * @param client client model (required) + * @return Call<Client> */ + + + + @Headers({ "Content-Type:application/json" }) + + + @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 45256eb3c8d..941465283a3 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 @@ -9,118 +9,194 @@ import okhttp3.RequestBody; -import java.io.File; import io.swagger.client.model.ModelApiResponse; import io.swagger.client.model.Pet; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import java.util.concurrent.*; import retrofit2.Response; + 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({ "Content-Type:application/json" }) + + + + + @POST("pet") CompletionStage> addPet( - @retrofit2.http.Body Pet body + @retrofit2.http.Body Pet pet ); + /** * Deletes a pet * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Call<Void> */ + + + + @DELETE("pet/{petId}") CompletionStage> deletePet( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Header("api_key") String apiKey + @retrofit2.http.Path("petId") Integer petId, @retrofit2.http.Header("api_key") String apiKey ); + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @return Call<List<Pet>> */ + + + + @GET("pet/findByStatus") CompletionStage>> findPetsByStatus( - @retrofit2.http.Query("status") CSVParams status + @retrofit2.http.Path("status") List status ); + /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @return Call<List<Pet>> */ + + + + @GET("pet/findByTags") CompletionStage>> findPetsByTags( - @retrofit2.http.Query("tags") CSVParams tags + @retrofit2.http.Path("tags") List tags ); + /** * Find pet by ID * Returns a single pet + * @param petId ID of pet to return (required) + * @return Call<Pet> */ + + + + @GET("pet/{petId}") CompletionStage> getPetById( - @retrofit2.http.Path("petId") Long petId + @retrofit2.http.Path("petId") Integer petId ); + /** * 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({ "Content-Type:application/json" }) + + + + + @PUT("pet") CompletionStage> updatePet( - @retrofit2.http.Body Pet body + @retrofit2.http.Body Pet pet ); + /** * Updates a pet in the store with form data * + * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) + + * @param body (optional) + * @return Call<Void> */ - @retrofit2.http.FormUrlEncoded + + + + + @Headers({ + "Content-Type:application/x-www-form-urlencoded" + }) + + + @POST("pet/{petId}") CompletionStage> updatePetWithForm( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Field("name") String name, @retrofit2.http.Field("status") String status + @retrofit2.http.Path("petId") Integer petId, @retrofit2.http.Body Object body ); + /** * uploads an image * + * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) + + * @param body (optional) + * @return Call<ModelApiResponse> */ - @retrofit2.http.Multipart + + + + @POST("pet/{petId}/uploadImage") CompletionStage> uploadFile( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part okhttp3.MultipartBody.Part file + @retrofit2.http.Path("petId") Integer petId, @retrofit2.http.Body Object body ); + } + 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..2e368d4e21c 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 @@ -11,55 +11,94 @@ import io.swagger.client.model.Order; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import java.util.concurrent.*; import retrofit2.Response; + public interface StoreApi { + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @return Call<Void> */ + + + + @DELETE("store/order/{order_id}") CompletionStage> deleteOrder( @retrofit2.http.Path("order_id") String orderId ); + /** * Returns pet inventories by status * Returns a map of status codes to quantities + * @return Call<Map<String, Integer>> */ + + + + @GET("store/inventory") CompletionStage>> getInventory(); + /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @return Call<Order> */ + + + + @GET("store/order/{order_id}") CompletionStage> getOrderById( - @retrofit2.http.Path("order_id") Long orderId + @retrofit2.http.Path("order_id") Integer orderId ); + /** * 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> */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @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 e5792d9ec00..cedd83434b9 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 @@ -11,101 +11,188 @@ import io.swagger.client.model.User; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import java.util.concurrent.*; import retrofit2.Response; + 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> */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @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) + * @return Call<Void> */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("user/createWithArray") CompletionStage> createUsersWithArrayInput( @retrofit2.http.Body List body ); + /** * Creates list of users with given input array * + * @param body List of user object (required) + * @return Call<Void> */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("user/createWithList") CompletionStage> createUsersWithListInput( @retrofit2.http.Body List body ); + /** * Delete user * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @return Call<Void> */ + + + + @DELETE("user/{username}") CompletionStage> deleteUser( @retrofit2.http.Path("username") String username ); + /** * Get user by user name * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return Call<User> */ + + + + @GET("user/{username}") CompletionStage> getUserByName( @retrofit2.http.Path("username") String username ); + /** * Logs user into the system * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return Call<String> */ + + + + @GET("user/login") CompletionStage> loginUser( - @retrofit2.http.Query("username") String username, @retrofit2.http.Query("password") String password + @retrofit2.http.Path("username") String username, @retrofit2.http.Path("password") String password ); + /** * Logs out current logged in user session * + * @return Call<Void> */ + + + + @GET("user/logout") CompletionStage> logoutUser(); + /** * Updated user * This can only be done by the logged in user. + + * @param user Updated user object (required) + * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @return Call<Void> */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @PUT("user/{username}") CompletionStage> updateUser( - @retrofit2.http.Path("username") String username, @retrofit2.http.Body User body + @retrofit2.http.Body User user, @retrofit2.http.Path("username") String username ); + } + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index e2bb686e935..81d0bb3f252 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -30,66 +30,79 @@ */ public class AdditionalPropertiesClass { + @JsonProperty("map_property") private Map mapProperty = null; - + @JsonProperty("map_of_map_property") private Map> mapOfMapProperty = null; - + public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; return this; } 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; } - - /** - * Get mapProperty - * @return mapProperty + /** + * Get mapProperty + * @return mapProperty **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } - public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } - + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; return this; } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { - this.mapOfMapProperty = new HashMap>(); + this.mapOfMapProperty = new HashMap<>(); } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } - - /** - * Get mapOfMapProperty - * @return mapOfMapProperty + /** + * Get mapOfMapProperty + * @return mapOfMapProperty **/ + + + + @Valid - @ApiModelProperty(value = "") + + + + +@ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -107,8 +120,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapProperty, mapOfMapProperty); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -131,5 +143,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Animal.java index 023cb11b7eb..abd1a26a6bc 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Animal.java @@ -27,57 +27,72 @@ /** * Animal */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true ) + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Discriminator{propertyName='className', mapping=null}", visible = true ) @JsonSubTypes({ + @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + }) public class Animal { + @JsonProperty("className") private String className = null; - + @JsonProperty("color") private String color = "red"; - + public Animal className(String className) { this.className = className; return this; } - /** - * Get className - * @return className + + /** + * Get className + * @return className **/ + @NotNull - @ApiModelProperty(required = true, value = "") + + + + + +@ApiModelProperty(required = true, value = "") public String getClassName() { return className; } - public void setClassName(String className) { this.className = className; } - + public Animal color(String color) { this.color = color; return this; } - /** - * Get color - * @return color + + /** + * Get color + * @return color **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getColor() { return color; } - public void setColor(String color) { this.color = color; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -95,8 +110,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(className, color); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -119,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/AnimalFarm.java deleted file mode 100644 index fc38d86a0aa..00000000000 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/AnimalFarm.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 io.swagger.client.model.Animal; -import java.util.ArrayList; -import java.util.List; -import javax.validation.constraints.*; -import javax.validation.Valid; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index 87d66e0750d..b43473676c5 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -30,37 +30,46 @@ */ public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") private List> arrayArrayNumber = null; - + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; return this; } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } + this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber **/ + + + + @Valid - @ApiModelProperty(value = "") + + + + +@ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } - public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -77,8 +86,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayArrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 50e09468219..4f8590a490c 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -30,37 +30,46 @@ */ public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") private List arrayNumber = null; - + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; return this; } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } + this.arrayNumber.add(arrayNumberItem); return this; } - - /** - * Get arrayNumber - * @return arrayNumber + + /** + * Get arrayNumber + * @return arrayNumber **/ + + + + @Valid - @ApiModelProperty(value = "") + + + + +@ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } - public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -77,8 +86,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayTest.java index b944839bc47..912f7dbb2a4 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayTest.java @@ -30,96 +30,120 @@ */ public class ArrayTest { + @JsonProperty("array_of_string") private List arrayOfString = null; - + @JsonProperty("array_array_of_integer") private List> arrayArrayOfInteger = null; - + @JsonProperty("array_array_of_model") private List> arrayArrayOfModel = null; - + public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; return this; } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } + this.arrayOfString.add(arrayOfStringItem); return this; } - - /** - * Get arrayOfString - * @return arrayOfString + + /** + * Get arrayOfString + * @return arrayOfString **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } - public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } - + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger **/ + + + + @Valid - @ApiModelProperty(value = "") + + + + +@ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } - + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel **/ + + + + @Valid - @ApiModelProperty(value = "") + + + + +@ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } - public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -138,8 +162,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -163,5 +186,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Capitalization.java index e7a0b0ac935..ccc6cc11d91 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Capitalization.java @@ -27,133 +27,163 @@ */ public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel = null; - + @JsonProperty("CapitalCamel") private String capitalCamel = null; - + @JsonProperty("small_Snake") private String smallSnake = null; - + @JsonProperty("Capital_Snake") private String capitalSnake = null; - + @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints = null; - + @JsonProperty("ATT_NAME") private String ATT_NAME = null; - + public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; return this; } - /** - * Get smallCamel - * @return smallCamel + + /** + * Get smallCamel + * @return smallCamel **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } - public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } - + public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; return this; } - /** - * Get capitalCamel - * @return capitalCamel + + /** + * Get capitalCamel + * @return capitalCamel **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } - public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } - + public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; return this; } - /** - * Get smallSnake - * @return smallSnake + + /** + * Get smallSnake + * @return smallSnake **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } - public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } - + public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; return this; } - /** - * Get capitalSnake - * @return capitalSnake + + /** + * Get capitalSnake + * @return capitalSnake **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } - public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } - + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; return this; } - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } - public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } - + public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; return this; } - /** - * Name of the pet - * @return ATT_NAME + + /** + * Name of the pet + * @return ATT_NAME **/ - @ApiModelProperty(value = "Name of the pet ") + + + + + +@ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } - public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -175,8 +205,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -203,5 +232,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Cat.java index 7c513d6d6dd..67d48202332 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Cat.java @@ -28,28 +28,87 @@ */ public class Cat extends Animal { + + @JsonProperty("className") + private String className = null; + + @JsonProperty("color") + private String color = "red"; + @JsonProperty("declawed") private Boolean declawed = null; + + public Cat className(String className) { + this.className = className; + return this; + } + + + /** + * Get className + * @return className + **/ + + @NotNull + + + + + +@ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Cat color(String color) { + this.color = color; + return this; + } + + + /** + * Get color + * @return color + **/ + + + + +@ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; } - /** - * Get declawed - * @return declawed + + /** + * Get declawed + * @return declawed **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Boolean isDeclawed() { return declawed; } - public void setDeclawed(Boolean declawed) { this.declawed = declawed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -59,21 +118,24 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && + return Objects.equals(this.className, cat.className) && + Objects.equals(this.color, cat.color) && + Objects.equals(this.declawed, cat.declawed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(declawed, super.hashCode()); + return Objects.hash(className, color, declawed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); sb.append("}"); return sb.toString(); @@ -90,5 +152,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Category.java index bf8840d5fcf..62f8513c081 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Category.java @@ -27,49 +27,59 @@ */ public class Category { + @JsonProperty("id") private Long id = null; - + @JsonProperty("name") private String name = null; - + public Category id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Category name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -87,8 +97,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -111,5 +120,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ClassModel.java index f3d9160e3db..bdd7c3f6108 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ClassModel.java @@ -24,32 +24,36 @@ /** * Model for testing model with \"_class\" property - */ -@ApiModel(description = "Model for testing model with \"_class\" property") + */@ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { + @JsonProperty("_class") private String propertyClass = null; - + public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -66,8 +70,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,5 +92,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Client.java index a09f13e7a2c..a7d9ace732d 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Client.java @@ -27,28 +27,33 @@ */ public class Client { + @JsonProperty("client") private String client = null; - + public Client client(String client) { this.client = client; return this; } - /** - * Get client - * @return client + + /** + * Get client + * @return client **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getClient() { return client; } - public void setClient(String client) { this.client = client; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -65,8 +70,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(client); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -88,5 +92,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Dog.java index 3835e2aca37..59d3c8dadc1 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Dog.java @@ -28,28 +28,87 @@ */ public class Dog extends Animal { + + @JsonProperty("className") + private String className = null; + + @JsonProperty("color") + private String color = "red"; + @JsonProperty("breed") private String breed = null; + + public Dog className(String className) { + this.className = className; + return this; + } + + + /** + * Get className + * @return className + **/ + + @NotNull + + + + + +@ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Dog color(String color) { + this.color = color; + return this; + } + + + /** + * Get color + * @return color + **/ + + + + +@ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Dog breed(String breed) { this.breed = breed; return this; } - /** - * Get breed - * @return breed + + /** + * Get breed + * @return breed **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getBreed() { return breed; } - public void setBreed(String breed) { this.breed = breed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -59,21 +118,24 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && + return Objects.equals(this.className, dog.className) && + Objects.equals(this.color, dog.color) && + Objects.equals(this.breed, dog.breed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(breed, super.hashCode()); + return Objects.hash(className, color, breed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); sb.append("}"); return sb.toString(); @@ -90,5 +152,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumArrays.java index 2019cbae634..4506c62fe6b 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumArrays.java @@ -29,12 +29,13 @@ */ public class EnumArrays { - /** + + /** * Gets or Sets justSymbol */ public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), + GREATER_THAN_OR_EQUAL_TO(">="), DOLLAR("$"); private String value; @@ -42,8 +43,9 @@ public enum JustSymbolEnum { JustSymbolEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -52,8 +54,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static JustSymbolEnum fromValue(String text) { for (JustSymbolEnum b : JustSymbolEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -62,17 +65,20 @@ public static JustSymbolEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("just_symbol") private JustSymbolEnum justSymbol = null; - - /** + + + /** * Gets or Sets arrayEnum */ public enum ArrayEnumEnum { - FISH("fish"), + FISH("fish"), CRAB("crab"); private String value; @@ -80,8 +86,9 @@ public enum ArrayEnumEnum { ArrayEnumEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -90,8 +97,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static ArrayEnumEnum fromValue(String text) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -100,56 +108,67 @@ public static ArrayEnumEnum fromValue(String text) { } return null; } + } - + @JsonProperty("array_enum") private List arrayEnum = null; - + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; return this; } - /** - * Get justSymbol - * @return justSymbol + + /** + * Get justSymbol + * @return justSymbol **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } - public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } - + public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; return this; } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } + this.arrayEnum.add(arrayEnumItem); return this; } - - /** - * Get arrayEnum - * @return arrayEnum + + /** + * Get arrayEnum + * @return arrayEnum **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } - public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -167,8 +186,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -191,5 +209,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumClass.java index f3211289d46..9414211ef6c 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumClass.java @@ -13,16 +13,17 @@ package io.swagger.client.model; -import java.util.Objects; -import javax.validation.constraints.*; -import javax.validation.Valid; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + + /** * Gets or Sets EnumClass */ + public enum EnumClass { _ABC("_abc"), @@ -37,7 +38,9 @@ public enum EnumClass { this.value = value; } + @JsonValue + public String getValue() { return value; } @@ -47,7 +50,9 @@ public String toString() { return String.valueOf(value); } + @JsonCreator + public static EnumClass fromValue(String text) { for (EnumClass b : EnumClass.values()) { if (String.valueOf(b.value).equals(text)) { @@ -56,5 +61,8 @@ public static EnumClass fromValue(String text) { } return null; } + } + + 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 779c3abcc1b..fe21368b7fe 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 @@ -28,14 +28,14 @@ */ public class EnumTest { - /** + + /** * Gets or Sets enumString */ public enum EnumStringEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"), - EMPTY(""); private String value; @@ -43,8 +43,9 @@ public enum EnumStringEnum { EnumStringEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -53,8 +54,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumStringEnum fromValue(String text) { for (EnumStringEnum b : EnumStringEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -63,17 +65,19 @@ public static EnumStringEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_string") private EnumStringEnum enumString = null; - - /** + + /** * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(1), NUMBER_MINUS_1(-1); private Integer value; @@ -81,8 +85,9 @@ public enum EnumIntegerEnum { EnumIntegerEnum(Integer value) { this.value = value; } - + @JsonValue + public Integer getValue() { return value; } @@ -91,8 +96,9 @@ public Integer getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumIntegerEnum fromValue(String text) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -101,17 +107,19 @@ public static EnumIntegerEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger = null; - - /** + + /** * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(1.1), NUMBER_MINUS_1_DOT_2(-1.2); private Double value; @@ -119,8 +127,9 @@ public enum EnumNumberEnum { EnumNumberEnum(Double value) { this.value = value; } - + @JsonValue + public Double getValue() { return value; } @@ -129,8 +138,9 @@ public Double getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumNumberEnum fromValue(String text) { for (EnumNumberEnum b : EnumNumberEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -139,88 +149,110 @@ public static EnumNumberEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_number") private EnumNumberEnum enumNumber = null; - + @JsonProperty("outerEnum") private OuterEnum outerEnum = null; - + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; } - /** - * Get enumString - * @return enumString + + /** + * Get enumString + * @return enumString **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } - public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } - + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; } - /** - * Get enumInteger - * @return enumInteger + + /** + * Get enumInteger + * @return enumInteger **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } - public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } - + public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; return this; } - /** - * Get enumNumber - * @return enumNumber + + /** + * Get enumNumber + * @return enumNumber **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } - public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - + public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; return this; } - /** - * Get outerEnum - * @return outerEnum + + /** + * Get outerEnum + * @return outerEnum **/ + + + + @Valid - @ApiModelProperty(value = "") + + +@ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -240,8 +272,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -266,5 +297,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\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 adf0a66ceeb..d799808eefb 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 @@ -31,298 +31,365 @@ */ public class FormatTest { + @JsonProperty("integer") private Integer integer = null; - + @JsonProperty("int32") private Integer int32 = null; - + @JsonProperty("int64") private Long int64 = null; - + @JsonProperty("number") private BigDecimal number = null; - + @JsonProperty("float") private Float _float = null; - + @JsonProperty("double") private Double _double = null; - + @JsonProperty("string") private String string = null; - + @JsonProperty("byte") - private byte[] _byte = null; - + private String _byte = null; + @JsonProperty("binary") - private byte[] binary = null; - + private String binary = null; + @JsonProperty("date") private LocalDate date = null; - + @JsonProperty("dateTime") private OffsetDateTime dateTime = null; - + @JsonProperty("uuid") private UUID uuid = null; - + @JsonProperty("password") private String password = null; - + public FormatTest integer(Integer integer) { this.integer = integer; return this; } - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer **/ - @Min(10) @Max(100) @ApiModelProperty(value = "") + + + + + + @Min(10) @Max(100)@ApiModelProperty(value = "") public Integer getInteger() { return integer; } - public void setInteger(Integer integer) { this.integer = integer; } - + public FormatTest int32(Integer int32) { this.int32 = int32; return this; } - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 **/ - @Min(20) @Max(200) @ApiModelProperty(value = "") + + + + + + @Min(20) @Max(200)@ApiModelProperty(value = "") public Integer getInt32() { return int32; } - public void setInt32(Integer int32) { this.int32 = int32; } - + public FormatTest int64(Long int64) { this.int64 = int64; return this; } - /** - * Get int64 - * @return int64 + + /** + * Get int64 + * @return int64 **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Long getInt64() { return int64; } - public void setInt64(Long int64) { this.int64 = int64; } - + public FormatTest number(BigDecimal number) { this.number = number; return this; } - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number + + /** + * Get number + * @return number **/ + @NotNull + + + + @Valid - @DecimalMin("32.1") @DecimalMax("543.2") @ApiModelProperty(required = true, value = "") + + +@ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } - public void setNumber(BigDecimal number) { this.number = number; } - + public FormatTest _float(Float _float) { this._float = _float; return this; } - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float + + /** + * Get _float + * @return _float **/ - @DecimalMin("54.3") @DecimalMax("987.6") @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Float getFloat() { return _float; } - public void setFloat(Float _float) { this._float = _float; } - + public FormatTest _double(Double _double) { this._double = _double; return this; } - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double + + /** + * Get _double + * @return _double **/ - @DecimalMin("67.8") @DecimalMax("123.4") @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Double getDouble() { return _double; } - public void setDouble(Double _double) { this._double = _double; } - + public FormatTest string(String string) { this.string = string; return this; } - /** - * Get string - * @return string + + /** + * Get string + * @return string **/ - @Pattern(regexp="/[a-z]/i") @ApiModelProperty(value = "") + + + + + + @Pattern(regexp="/[a-z]/i")@ApiModelProperty(value = "") public String getString() { return string; } - public void setString(String string) { this.string = string; } - - public FormatTest _byte(byte[] _byte) { + + public FormatTest _byte(String _byte) { this._byte = _byte; return this; } - /** - * Get _byte - * @return _byte + + /** + * Get _byte + * @return _byte **/ + @NotNull - @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$") @ApiModelProperty(required = true, value = "") - public byte[] getByte() { + + + + + + @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$")@ApiModelProperty(required = true, value = "") + public String getByte() { return _byte; } - - public void setByte(byte[] _byte) { + public void setByte(String _byte) { this._byte = _byte; } - - public FormatTest binary(byte[] binary) { + + public FormatTest binary(String binary) { this.binary = binary; return this; } - /** - * Get binary - * @return binary + + /** + * Get binary + * @return binary **/ - @ApiModelProperty(value = "") - public byte[] getBinary() { + + + + + +@ApiModelProperty(value = "") + public String getBinary() { return binary; } - - public void setBinary(byte[] binary) { + public void setBinary(String binary) { this.binary = binary; } - + public FormatTest date(LocalDate date) { this.date = date; return this; } - /** - * Get date - * @return date + + /** + * Get date + * @return date **/ + @NotNull + + + + @Valid - @ApiModelProperty(required = true, value = "") + + +@ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } - public void setDate(LocalDate date) { this.date = date; } - + public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ + + + + @Valid - @ApiModelProperty(value = "") + + +@ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ + + + + @Valid - @ApiModelProperty(value = "") + + +@ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public FormatTest password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ + @NotNull - @Size(min=10,max=64) @ApiModelProperty(required = true, value = "") + + + + + +@ApiModelProperty(required = true, value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -351,8 +418,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -386,5 +452,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 5f86fb84a96..ea805fbd8db 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -27,31 +27,43 @@ */ public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar = null; - + @JsonProperty("foo") private String foo = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getBar() { return bar; } - - /** - * Get foo - * @return foo + + + /** + * Get foo + * @return foo **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getFoo() { return foo; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -69,8 +81,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, foo); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -93,5 +104,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MapTest.java index 7c013ad8e69..adc34662ea1 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MapTest.java @@ -30,15 +30,17 @@ */ public class MapTest { + @JsonProperty("map_map_of_string") private Map> mapMapOfString = null; - - /** + + + /** * Gets or Sets inner */ public enum InnerEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"); private String value; @@ -46,8 +48,9 @@ public enum InnerEnum { InnerEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -56,8 +59,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static InnerEnum fromValue(String text) { for (InnerEnum b : InnerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -66,65 +70,78 @@ public static InnerEnum fromValue(String text) { } return null; } + } - + @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; - + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; } 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; } - - /** - * Get mapMapOfString - * @return mapMapOfString + /** + * Get mapMapOfString + * @return mapMapOfString **/ + + + + @Valid - @ApiModelProperty(value = "") + + + + +@ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } - public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } - + public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; return this; } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } + this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } - - /** - * Get mapOfEnumString - * @return mapOfEnumString + /** + * Get mapOfEnumString + * @return mapOfEnumString **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } - public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -142,8 +159,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -166,5 +182,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index d484a14f09c..4f5c7fea4db 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -33,81 +33,101 @@ */ public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid = null; - + @JsonProperty("dateTime") private OffsetDateTime dateTime = null; - + @JsonProperty("map") private Map map = null; - + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ + + + + @Valid - @ApiModelProperty(value = "") + + +@ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ + + + + @Valid - @ApiModelProperty(value = "") + + +@ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; return this; } 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; } - - /** - * Get map - * @return map + /** + * Get map + * @return map **/ + + + + @Valid - @ApiModelProperty(value = "") + + + + +@ApiModelProperty(value = "") public Map getMap() { return map; } - public void setMap(Map map) { this.map = map; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -126,8 +146,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(uuid, dateTime, map); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -151,5 +170,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 89ed29eca5d..7c9a45eb198 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 @@ -24,53 +24,62 @@ /** * Model for testing model name starting with number - */ -@ApiModel(description = "Model for testing model name starting with number") + */@ApiModel(description = "Model for testing model name starting with number") public class Model200Response { + @JsonProperty("name") private Integer name = null; - + @JsonProperty("class") private String propertyClass = null; - + public Model200Response name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - + public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -88,8 +97,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -112,5 +120,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelApiResponse.java index acfb194d9d7..fbf2dccdac3 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -27,70 +27,85 @@ */ public class ModelApiResponse { + @JsonProperty("code") private Integer code = null; - + @JsonProperty("type") private String type = null; - + @JsonProperty("message") private String message = null; - + public ModelApiResponse code(Integer code) { this.code = code; return this; } - /** - * Get code - * @return code + + /** + * Get code + * @return code **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Integer getCode() { return code; } - public void setCode(Integer code) { this.code = code; } - + public ModelApiResponse type(String type) { this.type = type; return this; } - /** - * Get type - * @return type + + /** + * Get type + * @return type **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getType() { return type; } - public void setType(String type) { this.type = type; } - + public ModelApiResponse message(String message) { this.message = message; return this; } - /** - * Get message - * @return message + + /** + * Get message + * @return message **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -109,8 +124,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(code, type, message); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -134,5 +148,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelReturn.java index d372354eb7e..e0e87169e69 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelReturn.java @@ -24,32 +24,36 @@ /** * Model for testing reserved words - */ -@ApiModel(description = "Model for testing reserved words") + */@ApiModel(description = "Model for testing reserved words") public class ModelReturn { + @JsonProperty("return") private Integer _return = null; - + public ModelReturn _return(Integer _return) { this._return = _return; return this; } - /** - * Get _return - * @return _return + + /** + * Get _return + * @return _return **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Integer getReturn() { return _return; } - public void setReturn(Integer _return) { this._return = _return; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -66,8 +70,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(_return); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,5 +92,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 c09048cce39..b73ebb07219 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 @@ -24,78 +24,100 @@ /** * Model for testing model name same as property name - */ -@ApiModel(description = "Model for testing model name same as property name") + */@ApiModel(description = "Model for testing model name same as property name") public class Name { + @JsonProperty("name") private Integer name = null; - + @JsonProperty("snake_case") private Integer snakeCase = null; - + @JsonProperty("property") private String property = null; - + @JsonProperty("123Number") private Integer _123Number = null; - + public Name name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ + @NotNull - @ApiModelProperty(required = true, value = "") + + + + + +@ApiModelProperty(required = true, value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - - /** - * Get snakeCase - * @return snakeCase + + + /** + * Get snakeCase + * @return snakeCase **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } - + public Name property(String property) { this.property = property; return this; } - /** - * Get property - * @return property + + /** + * Get property + * @return property **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getProperty() { return property; } - public void setProperty(String property) { this.property = property; } - - /** - * Get _123Number - * @return _123Number + + + /** + * Get _123Number + * @return _123Number **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -115,8 +137,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, snakeCase, property, _123Number); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -141,5 +162,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/NumberOnly.java index 91ab4497dc2..f8717b6c481 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/NumberOnly.java @@ -28,29 +28,35 @@ */ public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber = null; - + public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; return this; } - /** - * Get justNumber - * @return justNumber + + /** + * Get justNumber + * @return justNumber **/ + + + + @Valid - @ApiModelProperty(value = "") + + +@ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } - public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,8 +73,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -90,5 +95,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Order.java index 35d1f3e67e1..2b97dcd5006 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Order.java @@ -28,26 +28,26 @@ */ public class Order { + @JsonProperty("id") private Long id = null; - + @JsonProperty("petId") private Long petId = null; - + @JsonProperty("quantity") private Integer quantity = null; - + @JsonProperty("shipDate") private OffsetDateTime shipDate = null; - - /** + + /** * Order Status */ public enum StatusEnum { - PLACED("placed"), + PLACED("placed"), APPROVED("approved"), - DELIVERED("delivered"); private String value; @@ -55,8 +55,9 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -65,8 +66,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -75,124 +77,156 @@ public static StatusEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("status") private StatusEnum status = null; - + @JsonProperty("complete") private Boolean complete = false; - + public Order id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Order petId(Long petId) { this.petId = petId; return this; } - /** - * Get petId - * @return petId + + /** + * Get petId + * @return petId **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Long getPetId() { return petId; } - public void setPetId(Long petId) { this.petId = petId; } - + public Order quantity(Integer quantity) { this.quantity = quantity; return this; } - /** - * Get quantity - * @return quantity + + /** + * Get quantity + * @return quantity **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } - public void setQuantity(Integer quantity) { this.quantity = quantity; } - + public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; return this; } - /** - * Get shipDate - * @return shipDate + + /** + * Get shipDate + * @return shipDate **/ + + + + @Valid - @ApiModelProperty(value = "") + + +@ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } - public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } - + public Order status(StatusEnum status) { this.status = status; return this; } - /** - * Order Status - * @return status + + /** + * Order Status + * @return status **/ - @ApiModelProperty(value = "Order Status") + + + + + +@ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - + public Order complete(Boolean complete) { this.complete = complete; return this; } - /** - * Get complete - * @return complete + + /** + * Get complete + * @return complete **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Boolean isComplete() { return complete; } - public void setComplete(Boolean complete) { this.complete = complete; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -214,8 +248,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -242,5 +275,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterComposite.java index 5b0e216eaa2..b75541bc56f 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterComposite.java @@ -28,71 +28,87 @@ */ public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber = null; - + @JsonProperty("my_string") private String myString = null; - + @JsonProperty("my_boolean") private Boolean myBoolean = null; - + public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; return this; } - /** - * Get myNumber - * @return myNumber + + /** + * Get myNumber + * @return myNumber **/ + + + + @Valid - @ApiModelProperty(value = "") + + +@ApiModelProperty(value = "") public BigDecimal getMyNumber() { return myNumber; } - public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } - + public OuterComposite myString(String myString) { this.myString = myString; return this; } - /** - * Get myString - * @return myString + + /** + * Get myString + * @return myString **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getMyString() { return myString; } - public void setMyString(String myString) { this.myString = myString; } - + public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; return this; } - /** - * Get myBoolean - * @return myBoolean + + /** + * Get myBoolean + * @return myBoolean **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Boolean getMyBoolean() { return myBoolean; } - public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -111,8 +127,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(myNumber, myString, myBoolean); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -136,5 +151,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterEnum.java index 778c8dca14a..3390d473c7b 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterEnum.java @@ -13,16 +13,17 @@ package io.swagger.client.model; -import java.util.Objects; -import javax.validation.constraints.*; -import javax.validation.Valid; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + + /** * Gets or Sets OuterEnum */ + public enum OuterEnum { PLACED("placed"), @@ -37,7 +38,9 @@ public enum OuterEnum { this.value = value; } + @JsonValue + public String getValue() { return value; } @@ -47,7 +50,9 @@ public String toString() { return String.valueOf(value); } + @JsonCreator + public static OuterEnum fromValue(String text) { for (OuterEnum b : OuterEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -56,5 +61,8 @@ public static OuterEnum fromValue(String text) { } return null; } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Pet.java index 145360c48a9..3215fe21ab7 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Pet.java @@ -31,29 +31,29 @@ */ public class Pet { + @JsonProperty("id") private Long id = null; - + @JsonProperty("category") private Category category = null; - + @JsonProperty("name") private String name = null; - + @JsonProperty("photoUrls") - private List photoUrls = new ArrayList(); - + private List photoUrls = new ArrayList<>(); + @JsonProperty("tags") private List tags = null; - - /** + + /** * pet status in the store */ public enum StatusEnum { - AVAILABLE("available"), + AVAILABLE("available"), PENDING("pending"), - SOLD("sold"); private String value; @@ -61,8 +61,9 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -71,8 +72,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -81,137 +83,175 @@ public static StatusEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("status") private StatusEnum status = null; - + public Pet id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Pet category(Category category) { this.category = category; return this; } - /** - * Get category - * @return category + + /** + * Get category + * @return category **/ + + + + @Valid - @ApiModelProperty(value = "") + + +@ApiModelProperty(value = "") public Category getCategory() { return category; } - public void setCategory(Category category) { this.category = category; } - + public Pet name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ + @NotNull - @ApiModelProperty(example = "doggie", required = true, value = "") + + + + + +@ApiModelProperty(example = "doggie", required = true, value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - + public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); return this; } - - /** - * Get photoUrls - * @return photoUrls + + /** + * Get photoUrls + * @return photoUrls **/ + @NotNull - @ApiModelProperty(required = true, value = "") + + + + + +@ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } - + public Pet tags(List tags) { this.tags = tags; return this; } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } + this.tags.add(tagsItem); return this; } - - /** - * Get tags - * @return tags + + /** + * Get tags + * @return tags **/ + + + + @Valid - @ApiModelProperty(value = "") + + + + +@ApiModelProperty(value = "") public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } - + public Pet status(StatusEnum status) { this.status = status; return this; } - /** - * pet status in the store - * @return status + + /** + * pet status in the store + * @return status **/ - @ApiModelProperty(value = "pet status in the store") + + + + + +@ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -233,8 +273,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -261,5 +300,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index dc2373a365d..03baf3d4a12 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -27,40 +27,51 @@ */ public class ReadOnlyFirst { + @JsonProperty("bar") private String bar = null; - + @JsonProperty("baz") private String baz = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getBar() { return bar; } - + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; } - /** - * Get baz - * @return baz + + /** + * Get baz + * @return baz **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getBaz() { return baz; } - public void setBaz(String baz) { this.baz = baz; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -78,8 +89,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, baz); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -102,5 +112,8 @@ private String toIndentedString(java.lang.Object o) { 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 f01a06d4c78..55e4f4ad11e 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 @@ -27,28 +27,33 @@ */ public class SpecialModelName { - @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + @JsonProperty("$special[property.name]") + private Long $specialPropertyName = null; + + 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 void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; - } +@ApiModelProperty(value = "") + public Long get$SpecialPropertyName() { + return $specialPropertyName; + } + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + } + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -57,22 +62,21 @@ public boolean equals(java.lang.Object o) { 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); } - - + @Override public String toString() { 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(); } @@ -88,5 +92,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Tag.java index 71ff1bfcf67..850d97a3f27 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Tag.java @@ -27,49 +27,59 @@ */ public class Tag { + @JsonProperty("id") private Long id = null; - + @JsonProperty("name") private String name = null; - + public Tag id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Tag name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -87,8 +97,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -111,5 +120,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/User.java index 82c6be534ec..089aaa71b74 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/User.java @@ -27,175 +27,215 @@ */ public class User { + @JsonProperty("id") private Long id = null; - + @JsonProperty("username") private String username = null; - + @JsonProperty("firstName") private String firstName = null; - + @JsonProperty("lastName") private String lastName = null; - + @JsonProperty("email") private String email = null; - + @JsonProperty("password") private String password = null; - + @JsonProperty("phone") private String phone = null; - + @JsonProperty("userStatus") private Integer userStatus = null; - + public User id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public User username(String username) { this.username = username; return this; } - /** - * Get username - * @return username + + /** + * Get username + * @return username **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getUsername() { return username; } - public void setUsername(String username) { this.username = username; } - + public User firstName(String firstName) { this.firstName = firstName; return this; } - /** - * Get firstName - * @return firstName + + /** + * Get firstName + * @return firstName **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getFirstName() { return firstName; } - public void setFirstName(String firstName) { this.firstName = firstName; } - + public User lastName(String lastName) { this.lastName = lastName; return this; } - /** - * Get lastName - * @return lastName + + /** + * Get lastName + * @return lastName **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getLastName() { return lastName; } - public void setLastName(String lastName) { this.lastName = lastName; } - + public User email(String email) { this.email = email; return this; } - /** - * Get email - * @return email + + /** + * Get email + * @return email **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getEmail() { return email; } - public void setEmail(String email) { this.email = email; } - + public User password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - + public User phone(String phone) { this.phone = phone; return this; } - /** - * Get phone - * @return phone + + /** + * Get phone + * @return phone **/ - @ApiModelProperty(value = "") + + + + + +@ApiModelProperty(value = "") public String getPhone() { return phone; } - public void setPhone(String phone) { this.phone = phone; } - + public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; } - /** - * User Status - * @return userStatus + + /** + * User Status + * @return userStatus **/ - @ApiModelProperty(value = "User Status") + + + + + +@ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } - public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -219,8 +259,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -249,5 +288,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..6fdc3702e80 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 @@ -2,14 +2,17 @@ import io.swagger.client.ApiClient; import io.swagger.client.model.Client; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for AnotherFakeApi */ @@ -22,6 +25,8 @@ public void setup() { api = new ApiClient().createService(AnotherFakeApi.class); } + + /** * To test special tags * @@ -29,9 +34,13 @@ public void setup() { */ @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..559492405ac 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,17 +3,18 @@ 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 io.swagger.client.model.OuterComposite; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for FakeApi */ @@ -27,6 +28,7 @@ public void setup() { } + /** * * @@ -34,7 +36,9 @@ public void setup() { */ @Test public void fakeOuterBooleanSerializeTest() { + Boolean body = null; + // Boolean response = api.fakeOuterBooleanSerialize(body); // TODO: test validations @@ -47,8 +51,10 @@ public void fakeOuterBooleanSerializeTest() { */ @Test public void fakeOuterCompositeSerializeTest() { - OuterComposite body = null; - // OuterComposite response = api.fakeOuterCompositeSerialize(body); + + OuterComposite outercomposite = null; + + // OuterComposite response = api.fakeOuterCompositeSerialize(outercomposite); // TODO: test validations } @@ -60,7 +66,9 @@ public void fakeOuterCompositeSerializeTest() { */ @Test public void fakeOuterNumberSerializeTest() { + BigDecimal body = null; + // BigDecimal response = api.fakeOuterNumberSerialize(body); // TODO: test validations @@ -73,7 +81,9 @@ public void fakeOuterNumberSerializeTest() { */ @Test public void fakeOuterStringSerializeTest() { + String body = null; + // String response = api.fakeOuterStringSerialize(body); // TODO: test validations @@ -86,8 +96,10 @@ public void fakeOuterStringSerializeTest() { */ @Test public void testClientModelTest() { - Client body = null; - // Client response = api.testClientModel(body); + + Client client = null; + + // Client response = api.testClientModel(client); // TODO: test validations } @@ -99,21 +111,10 @@ public void testClientModelTest() { */ @Test public void testEndpointParametersTest() { - BigDecimal number = null; - Double _double = null; - String patternWithoutDelimiter = null; - byte[] _byte = null; - Integer integer = null; - Integer int32 = null; - Long int64 = null; - Float _float = null; - String string = null; - byte[] binary = null; - LocalDate date = null; - DateTime 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); + + Object body = null; + + // Void response = api.testEndpointParameters(body); // TODO: test validations } @@ -125,17 +126,53 @@ public void testEndpointParametersTest() { */ @Test public void testEnumParametersTest() { - List enumFormStringArray = null; - String enumFormString = null; + + Object body = 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); + + // Void response = api.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); // TODO: test validations } + /** + * test inline additionalProperties + * + * + */ + @Test + public void testInlineAdditionalPropertiesTest() { + + Map body = null; + + // Void response = api.testInlineAdditionalProperties(body); + + // TODO: test validations + } + + /** + * test json serialization of form data + * + * + */ + @Test + public void testJsonFormDataTest() { + + Object body = null; + + // Void response = api.testJsonFormData(body); + + // 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..ab29f7ce6af 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 @@ -2,14 +2,17 @@ import io.swagger.client.ApiClient; import io.swagger.client.model.Client; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for FakeClassnameTags123Api */ @@ -23,6 +26,7 @@ public void setup() { } + /** * To test class name in snake case * @@ -30,10 +34,13 @@ public void setup() { */ @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..7b467b0b508 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 @@ -1,17 +1,19 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; -import java.io.File; 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.HashMap; import java.util.List; import java.util.Map; + /** * API tests for PetApi */ @@ -25,6 +27,7 @@ public void setup() { } + /** * Add a new pet to the store * @@ -32,8 +35,10 @@ public void setup() { */ @Test public void addPetTest() { - Pet body = null; - // Void response = api.addPet(body); + + Pet pet = null; + + // Void response = api.addPet(pet); // TODO: test validations } @@ -45,8 +50,11 @@ public void addPetTest() { */ @Test public void deletePetTest() { - Long petId = null; + + Integer petId = null; + String apiKey = null; + // Void response = api.deletePet(petId, apiKey); // TODO: test validations @@ -59,7 +67,9 @@ public void deletePetTest() { */ @Test public void findPetsByStatusTest() { + List status = null; + // List response = api.findPetsByStatus(status); // TODO: test validations @@ -72,7 +82,9 @@ public void findPetsByStatusTest() { */ @Test public void findPetsByTagsTest() { + List tags = null; + // List response = api.findPetsByTags(tags); // TODO: test validations @@ -85,7 +97,9 @@ public void findPetsByTagsTest() { */ @Test public void getPetByIdTest() { - Long petId = null; + + Integer petId = null; + // Pet response = api.getPetById(petId); // TODO: test validations @@ -98,8 +112,10 @@ public void getPetByIdTest() { */ @Test public void updatePetTest() { - Pet body = null; - // Void response = api.updatePet(body); + + Pet pet = null; + + // Void response = api.updatePet(pet); // TODO: test validations } @@ -111,10 +127,12 @@ public void updatePetTest() { */ @Test public void updatePetWithFormTest() { - Long petId = null; - String name = null; - String status = null; - // Void response = api.updatePetWithForm(petId, name, status); + + Integer petId = null; + + Object body = null; + + // Void response = api.updatePetWithForm(petId, body); // TODO: test validations } @@ -126,12 +144,15 @@ public void updatePetWithFormTest() { */ @Test public void uploadFileTest() { - Long petId = null; - String additionalMetadata = null; - File file = null; - // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + + Integer petId = null; + + Object body = null; + + // ModelApiResponse response = api.uploadFile(petId, body); // 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..f59141e4eed 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 @@ -2,14 +2,17 @@ import io.swagger.client.ApiClient; import io.swagger.client.model.Order; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for StoreApi */ @@ -23,6 +26,7 @@ public void setup() { } + /** * Delete purchase order by ID * @@ -30,7 +34,9 @@ public void setup() { */ @Test public void deleteOrderTest() { + String orderId = null; + // Void response = api.deleteOrder(orderId); // TODO: test validations @@ -43,6 +49,7 @@ public void deleteOrderTest() { */ @Test public void getInventoryTest() { + // Map response = api.getInventory(); // TODO: test validations @@ -55,7 +62,9 @@ public void getInventoryTest() { */ @Test public void getOrderByIdTest() { - Long orderId = null; + + Integer orderId = null; + // Order response = api.getOrderById(orderId); // TODO: test validations @@ -68,10 +77,13 @@ public void getOrderByIdTest() { */ @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..2f011d503a5 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 @@ -2,14 +2,17 @@ import io.swagger.client.ApiClient; 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; + /** * API tests for UserApi */ @@ -23,6 +26,7 @@ public void setup() { } + /** * Create user * @@ -30,8 +34,10 @@ public void setup() { */ @Test public void createUserTest() { - User body = null; - // Void response = api.createUser(body); + + User user = null; + + // Void response = api.createUser(user); // TODO: test validations } @@ -43,7 +49,9 @@ public void createUserTest() { */ @Test public void createUsersWithArrayInputTest() { + List body = null; + // Void response = api.createUsersWithArrayInput(body); // TODO: test validations @@ -56,7 +64,9 @@ public void createUsersWithArrayInputTest() { */ @Test public void createUsersWithListInputTest() { + List body = null; + // Void response = api.createUsersWithListInput(body); // TODO: test validations @@ -69,7 +79,9 @@ public void createUsersWithListInputTest() { */ @Test public void deleteUserTest() { + String username = null; + // Void response = api.deleteUser(username); // TODO: test validations @@ -82,7 +94,9 @@ public void deleteUserTest() { */ @Test public void getUserByNameTest() { + String username = null; + // User response = api.getUserByName(username); // TODO: test validations @@ -95,8 +109,11 @@ public void getUserByNameTest() { */ @Test public void loginUserTest() { + String username = null; + String password = null; + // String response = api.loginUser(username, password); // TODO: test validations @@ -109,6 +126,7 @@ public void loginUserTest() { */ @Test public void logoutUserTest() { + // Void response = api.logoutUser(); // TODO: test validations @@ -121,11 +139,15 @@ public void logoutUserTest() { */ @Test public void updateUserTest() { + + User user = null; + String username = null; - User body = null; - // Void response = api.updateUser(username, body); + + // Void response = api.updateUser(user, username); // TODO: test validations } + } diff --git a/samples/client/petstore/java/retrofit2/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit2/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/client/petstore/java/retrofit2/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/retrofit2/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-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/README.md b/samples/client/petstore/java/retrofit2/README.md index d5f7ec9f1ce..269894e5d38 100644 --- a/samples/client/petstore/java/retrofit2/README.md +++ b/samples/client/petstore/java/retrofit2/README.md @@ -32,10 +32,6 @@ 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. - ## Author apiteam@swagger.io diff --git a/samples/client/petstore/java/retrofit2/build.gradle b/samples/client/petstore/java/retrofit2/build.gradle index be4a7349272..ba8102fce1f 100644 --- a/samples/client/petstore/java/retrofit2/build.gradle +++ b/samples/client/petstore/java/retrofit2/build.gradle @@ -32,8 +32,11 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { + + sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 + } // Rename the aar correctly @@ -94,11 +97,17 @@ if(hasProperty('target') && target == 'android') { } ext { - oltu_version = "1.0.1" + oltu_version = "1.0.2" retrofit_version = "2.3.0" + swagger_annotations_version = "1.5.15" junit_version = "4.12" + + + + threetenbp_version = "1.3.5" + json_fire_version = "1.8.0" } @@ -106,10 +115,16 @@ dependencies { compile "com.squareup.retrofit2:retrofit:$retrofit_version" compile "com.squareup.retrofit2:converter-scalars:$retrofit_version" compile "com.squareup.retrofit2:converter-gson:$retrofit_version" + + compile "io.swagger:swagger-annotations:$swagger_annotations_version" compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" compile "io.gsonfire:gson-fire:$json_fire_version" + + compile "org.threeten:threetenbp:$threetenbp_version" + + testCompile "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/retrofit2/build.sbt b/samples/client/petstore/java/retrofit2/build.sbt index c7b77d03cb8..793537bd61e 100644 --- a/samples/client/petstore/java/retrofit2/build.sbt +++ b/samples/client/petstore/java/retrofit2/build.sbt @@ -11,10 +11,18 @@ lazy val root = (project in file(".")). libraryDependencies ++= Seq( "com.squareup.retrofit2" % "retrofit" % "2.3.0" % "compile", "com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile", + "com.squareup.retrofit2" % "converter-gson" % "2.3.0" % "compile", + + + + "io.swagger" % "swagger-annotations" % "1.5.15" % "compile", - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2" % "compile", + + "org.threeten" % "threetenbp" % "1.3.5" % "compile", + "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" diff --git a/samples/client/petstore/java/retrofit2/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/retrofit2/docs/AdditionalPropertiesClass.md index 0437c4dd8cc..b37862da7cf 100644 --- a/samples/client/petstore/java/retrofit2/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/java/retrofit2/docs/AdditionalPropertiesClass.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2/docs/Animal.md b/samples/client/petstore/java/retrofit2/docs/Animal.md index b3f325c3524..346caaf63f4 100644 --- a/samples/client/petstore/java/retrofit2/docs/Animal.md +++ b/samples/client/petstore/java/retrofit2/docs/Animal.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2/docs/AnimalFarm.md b/samples/client/petstore/java/retrofit2/docs/AnimalFarm.md deleted file mode 100644 index c7c7f1ddcce..00000000000 --- a/samples/client/petstore/java/retrofit2/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ - -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - diff --git a/samples/client/petstore/java/retrofit2/docs/AnotherFakeApi.md b/samples/client/petstore/java/retrofit2/docs/AnotherFakeApi.md index bcc1a3a45ce..792799b51e8 100644 --- a/samples/client/petstore/java/retrofit2/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/retrofit2/docs/AnotherFakeApi.md @@ -7,9 +7,11 @@ Method | HTTP request | Description [**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** another-fake/dummy | To test special tags + + # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -22,10 +24,13 @@ To test special tags //import io.swagger.client.api.AnotherFakeApi; + AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +42,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -52,3 +58,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + + diff --git a/samples/client/petstore/java/retrofit2/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/retrofit2/docs/ArrayOfArrayOfNumberOnly.md index 77292549927..3671a5e9190 100644 --- a/samples/client/petstore/java/retrofit2/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/java/retrofit2/docs/ArrayOfArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/retrofit2/docs/ArrayOfNumberOnly.md index e8cc4cd36dc..30b9b6648f4 100644 --- a/samples/client/petstore/java/retrofit2/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/java/retrofit2/docs/ArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2/docs/ArrayTest.md b/samples/client/petstore/java/retrofit2/docs/ArrayTest.md index 9feee16427f..4ab76343030 100644 --- a/samples/client/petstore/java/retrofit2/docs/ArrayTest.md +++ b/samples/client/petstore/java/retrofit2/docs/ArrayTest.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2/docs/Capitalization.md b/samples/client/petstore/java/retrofit2/docs/Capitalization.md index 0f3064c1996..9af7864f97e 100644 --- a/samples/client/petstore/java/retrofit2/docs/Capitalization.md +++ b/samples/client/petstore/java/retrofit2/docs/Capitalization.md @@ -13,3 +13,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2/docs/Cat.md b/samples/client/petstore/java/retrofit2/docs/Cat.md index 6e9f71ce7dd..5e408344021 100644 --- a/samples/client/petstore/java/retrofit2/docs/Cat.md +++ b/samples/client/petstore/java/retrofit2/docs/Cat.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **declawed** | **Boolean** | | [optional] + diff --git a/samples/client/petstore/java/retrofit2/docs/Category.md b/samples/client/petstore/java/retrofit2/docs/Category.md index e2df0803278..deb5a3e2a52 100644 --- a/samples/client/petstore/java/retrofit2/docs/Category.md +++ b/samples/client/petstore/java/retrofit2/docs/Category.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2/docs/ClassModel.md b/samples/client/petstore/java/retrofit2/docs/ClassModel.md index 64f880c8786..49c281cc0ed 100644 --- a/samples/client/petstore/java/retrofit2/docs/ClassModel.md +++ b/samples/client/petstore/java/retrofit2/docs/ClassModel.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2/docs/Client.md b/samples/client/petstore/java/retrofit2/docs/Client.md index 5c490ea166c..52b2f72c79c 100644 --- a/samples/client/petstore/java/retrofit2/docs/Client.md +++ b/samples/client/petstore/java/retrofit2/docs/Client.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2/docs/Dog.md b/samples/client/petstore/java/retrofit2/docs/Dog.md index ac7cea323ff..00e6446e9f5 100644 --- a/samples/client/petstore/java/retrofit2/docs/Dog.md +++ b/samples/client/petstore/java/retrofit2/docs/Dog.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **breed** | **String** | | [optional] + diff --git a/samples/client/petstore/java/retrofit2/docs/EnumArrays.md b/samples/client/petstore/java/retrofit2/docs/EnumArrays.md index 4dddc0bfd27..939a0e69587 100644 --- a/samples/client/petstore/java/retrofit2/docs/EnumArrays.md +++ b/samples/client/petstore/java/retrofit2/docs/EnumArrays.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] + ## Enum: JustSymbolEnum Name | Value @@ -20,8 +21,6 @@ DOLLAR | "$" ## Enum: List<ArrayEnumEnum> Name | Value ---- | ----- -FISH | "fish" -CRAB | "crab" diff --git a/samples/client/petstore/java/retrofit2/docs/EnumTest.md b/samples/client/petstore/java/retrofit2/docs/EnumTest.md index 08fee344882..9722c621962 100644 --- a/samples/client/petstore/java/retrofit2/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2/docs/EnumTest.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] + ## Enum: EnumStringEnum Name | Value diff --git a/samples/client/petstore/java/retrofit2/docs/FakeApi.md b/samples/client/petstore/java/retrofit2/docs/FakeApi.md index 3e052dea273..6d1d77bdf10 100644 --- a/samples/client/petstore/java/retrofit2/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2/docs/FakeApi.md @@ -15,6 +15,8 @@ Method | HTTP request | Description [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** fake/jsonFormData | test json serialization of form data + + # **fakeOuterBooleanSerialize** > Boolean fakeOuterBooleanSerialize(body) @@ -30,8 +32,11 @@ Test serialization of outer boolean types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body + +Boolean body = ; // Boolean | Input boolean as post body + try { Boolean result = apiInstance.fakeOuterBooleanSerialize(body); System.out.println(result); @@ -47,6 +52,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + ### Return type **Boolean** @@ -57,12 +63,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outercomposite) @@ -75,10 +82,13 @@ Test serialization of object with outer number type //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body + +OuterComposite 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 +100,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outercomposite** | [**OuterComposite**](.md)| Input composite as post body | [optional] + ### Return type @@ -102,8 +113,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterNumberSerialize** @@ -120,8 +132,11 @@ Test serialization of outer number types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body + +BigDecimal body = ; // BigDecimal | Input number as post body + try { BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); System.out.println(result); @@ -137,6 +152,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + ### Return type [**BigDecimal**](BigDecimal.md) @@ -147,8 +163,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterStringSerialize** @@ -165,8 +182,11 @@ Test serialization of outer string types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String body = "body_example"; // String | Input string as post body + +String body = ; // String | Input string as post body + try { String result = apiInstance.fakeOuterStringSerialize(body); System.out.println(result); @@ -182,6 +202,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**String**](String.md)| Input string as post body | [optional] + ### Return type **String** @@ -192,12 +213,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -210,10 +232,13 @@ To test \"client\" model //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +250,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -240,9 +266,10 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + # **testEndpointParameters** -> Void testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) +> Void testEndpointParameters(body) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -251,36 +278,17 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### 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.FakeApi; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure HTTP basic authorization: http_basic_test -HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); -http_basic_test.setUsername("YOUR USERNAME"); -http_basic_test.setPassword("YOUR PASSWORD"); 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 -Integer integer = 56; // Integer | None -Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None -Float _float = 3.4F; // Float | None -String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None -LocalDate date = new LocalDate(); // LocalDate | None -OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None -String password = "password_example"; // String | None -String paramCallback = "paramCallback_example"; // String | None + +Object body = ; // Object | + try { - Void result = apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + Void result = apiInstance.testEndpointParameters(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEndpointParameters"); @@ -292,20 +300,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **BigDecimal**| None | - **_double** | **Double**| None | - **patternWithoutDelimiter** | **String**| None | - **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] - **int64** | **Long**| None | [optional] - **_float** | **Float**| None | [optional] - **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] - **date** | **LocalDate**| None | [optional] - **dateTime** | **OffsetDateTime**| None | [optional] - **password** | **String**| None | [optional] - **paramCallback** | **String**| None | [optional] + **body** | [**Object**](Object.md)| | + ### Return type @@ -318,11 +314,12 @@ Name | Type | Description | Notes ### 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 + - **Accept**: Not defined + # **testEnumParameters** -> Void testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> Void testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger) To test enum parameters @@ -335,17 +332,23 @@ To test enum parameters //import io.swagger.client.api.FakeApi; + 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) + +Object body = ; // Object | + List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) -String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + +String enumHeaderString = Arrays.asList("enumHeaderString_example"); // 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) + +String enumQueryString = Arrays.asList("enumQueryString_example"); // String | Query parameter enum test (string) + +Integer enumQueryInteger = Arrays.asList(56); // Integer | Query parameter enum test (double) + try { - Void result = apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + Void result = apiInstance.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); @@ -357,14 +360,13 @@ 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] + **body** | [**Object**](Object.md)| | [optional] + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: ] + **enumHeaderString** | [**String**](.md)| Header parameter enum test (string) | [optional] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: ] + **enumQueryString** | [**String**](.md)| Query parameter enum test (string) | [optional] + **enumQueryInteger** | [**Integer**](.md)| Query parameter enum test (double) | [optional] + ### Return type @@ -377,16 +379,15 @@ No authorization required ### HTTP request headers - **Content-Type**: */* - - **Accept**: */* + - **Accept**: Not defined + # **testInlineAdditionalProperties** -> Void testInlineAdditionalProperties(param) +> Void testInlineAdditionalProperties(body) test inline additionalProperties - - ### Example ```java // Import classes: @@ -394,10 +395,13 @@ test inline additionalProperties //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body + +Map body = ; // Map | request body + try { - Void result = apiInstance.testInlineAdditionalProperties(param); + Void result = apiInstance.testInlineAdditionalProperties(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); @@ -409,7 +413,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **body** | [**Map<String, String>**](Map.md)| request body | + ### Return type @@ -424,14 +429,13 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined + # **testJsonFormData** -> Void testJsonFormData(param, param2) +> Void testJsonFormData(body) test json serialization of form data - - ### Example ```java // Import classes: @@ -439,11 +443,13 @@ test json serialization of form data //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String param = "param_example"; // String | field1 -String param2 = "param2_example"; // String | field2 + +Object body = ; // Object | + try { - Void result = apiInstance.testJsonFormData(param, param2); + Void result = apiInstance.testJsonFormData(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testJsonFormData"); @@ -455,8 +461,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **String**| field1 | - **param2** | **String**| field2 | + **body** | [**Object**](Object.md)| | + ### Return type @@ -471,3 +477,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined + + diff --git a/samples/client/petstore/java/retrofit2/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/retrofit2/docs/FakeClassnameTags123Api.md index 715fed0dc0b..2336289e187 100644 --- a/samples/client/petstore/java/retrofit2/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/retrofit2/docs/FakeClassnameTags123Api.md @@ -7,33 +7,28 @@ Method | HTTP request | Description [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** fake_classname_test | To test class name in snake case + + # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case ### 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.FakeClassnameTags123Api; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure API key authorization: api_key_query -ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); -api_key_query.setApiKey("YOUR API KEY"); -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model + +Client 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 +40,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -60,3 +56,5 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + + 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..bc11b93cb26 100644 --- a/samples/client/petstore/java/retrofit2/docs/FormatTest.md +++ b/samples/client/petstore/java/retrofit2/docs/FormatTest.md @@ -11,8 +11,8 @@ Name | Type | Description | Notes **_float** | **Float** | | [optional] **_double** | **Double** | | [optional] **string** | **String** | | [optional] -**_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**_byte** | **String** | | +**binary** | **String** | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] @@ -20,3 +20,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/retrofit2/docs/HasOnlyReadOnly.md index c1d0aac5672..5564ddcf28a 100644 --- a/samples/client/petstore/java/retrofit2/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/java/retrofit2/docs/HasOnlyReadOnly.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2/docs/MapTest.md b/samples/client/petstore/java/retrofit2/docs/MapTest.md index 714a97a40d9..74a6fe8ae70 100644 --- a/samples/client/petstore/java/retrofit2/docs/MapTest.md +++ b/samples/client/petstore/java/retrofit2/docs/MapTest.md @@ -8,12 +8,11 @@ Name | Type | Description | Notes **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] + ## Enum: Map<String, InnerEnum> Name | Value ---- | ----- -UPPER | "UPPER" -LOWER | "lower" diff --git a/samples/client/petstore/java/retrofit2/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/retrofit2/docs/MixedPropertiesAndAdditionalPropertiesClass.md index b12e2cd70e6..4507481b5a9 100644 --- a/samples/client/petstore/java/retrofit2/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/retrofit2/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2/docs/Model200Response.md b/samples/client/petstore/java/retrofit2/docs/Model200Response.md index 5b3a9a0e46d..8d2cc50bb83 100644 --- a/samples/client/petstore/java/retrofit2/docs/Model200Response.md +++ b/samples/client/petstore/java/retrofit2/docs/Model200Response.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2/docs/ModelApiResponse.md b/samples/client/petstore/java/retrofit2/docs/ModelApiResponse.md index 3eec8686cc9..06052b202f1 100644 --- a/samples/client/petstore/java/retrofit2/docs/ModelApiResponse.md +++ b/samples/client/petstore/java/retrofit2/docs/ModelApiResponse.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2/docs/ModelReturn.md b/samples/client/petstore/java/retrofit2/docs/ModelReturn.md index a679b04953e..a7845ba254b 100644 --- a/samples/client/petstore/java/retrofit2/docs/ModelReturn.md +++ b/samples/client/petstore/java/retrofit2/docs/ModelReturn.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2/docs/Name.md b/samples/client/petstore/java/retrofit2/docs/Name.md index ce2fb4dee50..a8d6fec9714 100644 --- a/samples/client/petstore/java/retrofit2/docs/Name.md +++ b/samples/client/petstore/java/retrofit2/docs/Name.md @@ -11,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2/docs/NumberOnly.md b/samples/client/petstore/java/retrofit2/docs/NumberOnly.md index a3feac7fadc..adfb36a95bb 100644 --- a/samples/client/petstore/java/retrofit2/docs/NumberOnly.md +++ b/samples/client/petstore/java/retrofit2/docs/NumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2/docs/Order.md b/samples/client/petstore/java/retrofit2/docs/Order.md index 268c617d1ff..7e4beff6df1 100644 --- a/samples/client/petstore/java/retrofit2/docs/Order.md +++ b/samples/client/petstore/java/retrofit2/docs/Order.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/retrofit2/docs/OuterComposite.md b/samples/client/petstore/java/retrofit2/docs/OuterComposite.md index 3f5a633c998..1963c7a0f73 100644 --- a/samples/client/petstore/java/retrofit2/docs/OuterComposite.md +++ b/samples/client/petstore/java/retrofit2/docs/OuterComposite.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2/docs/Pet.md b/samples/client/petstore/java/retrofit2/docs/Pet.md index 5b63109ef92..1492195a58d 100644 --- a/samples/client/petstore/java/retrofit2/docs/Pet.md +++ b/samples/client/petstore/java/retrofit2/docs/Pet.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/retrofit2/docs/PetApi.md b/samples/client/petstore/java/retrofit2/docs/PetApi.md index ea3c05ad412..c5748bb7cd3 100644 --- a/samples/client/petstore/java/retrofit2/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2/docs/PetApi.md @@ -14,33 +14,28 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** pet/{petId}/uploadImage | uploads an image + + # **addPet** -> Void addPet(body) +> Void addPet(pet) 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 + +Pet pet = ; // Pet | Pet object that needs to be added to the store + try { - Void result = apiInstance.addPet(body); + Void result = apiInstance.addPet(pet); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); @@ -52,7 +47,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -65,7 +61,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **deletePet** @@ -73,26 +70,20 @@ Name | Type | Description | Notes 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 | + +Integer petId = Arrays.asList(56); // Integer | Pet id to delete + +String apiKey = Arrays.asList("apiKey_example"); // String | + try { Void result = apiInstance.deletePet(petId, apiKey); System.out.println(result); @@ -106,8 +97,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | - **apiKey** | **String**| | [optional] + **petId** | [**Integer**](.md)| Pet id to delete | + **apiKey** | [**String**](.md)| | [optional] + ### Return type @@ -120,7 +112,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **findPetsByStatus** @@ -133,20 +126,15 @@ 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); @@ -160,7 +148,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: ] + ### Return type @@ -175,6 +164,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **findPetsByTags** > List<Pet> findPetsByTags(tags) @@ -186,20 +176,15 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### 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); @@ -215,6 +200,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | + ### Return type [**List<Pet>**](Pet.md) @@ -228,6 +214,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **getPetById** > Pet getPetById(petId) @@ -239,22 +226,15 @@ 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to return + try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -268,7 +248,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to return | + **petId** | [**Integer**](.md)| ID of pet to return | + ### Return type @@ -283,33 +264,27 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **updatePet** -> Void updatePet(body) +> Void updatePet(pet) 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 + +Pet pet = ; // Pet | Pet object that needs to be added to the store + try { - Void result = apiInstance.updatePet(body); + Void result = apiInstance.updatePet(pet); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); @@ -321,7 +296,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -334,37 +310,31 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updatePetWithForm** -> Void updatePetWithForm(petId, name, status) +> Void updatePetWithForm(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet that needs to be updated + +Object body = ; // Object | + try { - Void result = apiInstance.updatePetWithForm(petId, name, status); + Void result = apiInstance.updatePetWithForm(petId, body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePetWithForm"); @@ -376,9 +346,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet that needs to be updated | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -391,37 +361,31 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **uploadFile** -> ModelApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to update + +Object body = ; // Object | + try { - ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); + ModelApiResponse result = apiInstance.uploadFile(petId, body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFile"); @@ -433,9 +397,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet to update | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -450,3 +414,5 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json + + diff --git a/samples/client/petstore/java/retrofit2/docs/ReadOnlyFirst.md b/samples/client/petstore/java/retrofit2/docs/ReadOnlyFirst.md index 426b7cde95a..57655e5b49e 100644 --- a/samples/client/petstore/java/retrofit2/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/java/retrofit2/docs/ReadOnlyFirst.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2/docs/SpecialModelName.md b/samples/client/petstore/java/retrofit2/docs/SpecialModelName.md index c2c6117c552..f4259d2a73c 100644 --- a/samples/client/petstore/java/retrofit2/docs/SpecialModelName.md +++ b/samples/client/petstore/java/retrofit2/docs/SpecialModelName.md @@ -4,7 +4,8 @@ ## 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 134f0c36578..35b66fd8485 100644 --- a/samples/client/petstore/java/retrofit2/docs/StoreApi.md +++ b/samples/client/petstore/java/retrofit2/docs/StoreApi.md @@ -10,6 +10,8 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet + + # **deleteOrder** > Void deleteOrder(orderId) @@ -25,8 +27,11 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + +String orderId = Arrays.asList("orderId_example"); // String | ID of the order that needs to be deleted + try { Void result = apiInstance.deleteOrder(orderId); System.out.println(result); @@ -40,7 +45,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | + **orderId** | [**String**](.md)| ID of the order that needs to be deleted | + ### Return type @@ -53,7 +59,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getInventory** @@ -66,21 +73,13 @@ 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); @@ -93,6 +92,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type **Map<String, Integer>** @@ -106,6 +106,7 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json + # **getOrderById** > Order getOrderById(orderId) @@ -121,8 +122,11 @@ For valid response try integer IDs with value <= 5 or > 10. Other val //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched + +Integer orderId = Arrays.asList(56); // Integer | ID of pet that needs to be fetched + try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -136,7 +140,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | [**Integer**](.md)| ID of pet that needs to be fetched | + ### Return type @@ -151,14 +156,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -166,10 +170,13 @@ Place an order for a pet //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet + +Order 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"); @@ -181,7 +188,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](.md)| order placed for purchasing the pet | + ### Return type @@ -193,6 +201,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: */* - **Accept**: application/xml, application/json + + diff --git a/samples/client/petstore/java/retrofit2/docs/Tag.md b/samples/client/petstore/java/retrofit2/docs/Tag.md index de6814b55d5..7a97d4c6812 100644 --- a/samples/client/petstore/java/retrofit2/docs/Tag.md +++ b/samples/client/petstore/java/retrofit2/docs/Tag.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2/docs/User.md b/samples/client/petstore/java/retrofit2/docs/User.md index 8b6753dd284..cf7f9ce1312 100644 --- a/samples/client/petstore/java/retrofit2/docs/User.md +++ b/samples/client/petstore/java/retrofit2/docs/User.md @@ -15,3 +15,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2/docs/UserApi.md b/samples/client/petstore/java/retrofit2/docs/UserApi.md index 40096ec05bc..619b98b9fa7 100644 --- a/samples/client/petstore/java/retrofit2/docs/UserApi.md +++ b/samples/client/petstore/java/retrofit2/docs/UserApi.md @@ -14,9 +14,11 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** user/{username} | Updated user + + # **createUser** -> Void createUser(body) +> Void createUser(user) Create user @@ -29,10 +31,13 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object + +User user = ; // User | Created user object + try { - Void result = apiInstance.createUser(body); + Void result = apiInstance.createUser(user); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); @@ -44,7 +49,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](.md)| Created user object | + ### Return type @@ -56,8 +62,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithArrayInput** @@ -65,8 +72,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -74,8 +79,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { Void result = apiInstance.createUsersWithArrayInput(body); System.out.println(result); @@ -91,6 +99,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type [**Void**](.md) @@ -101,8 +110,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithListInput** @@ -110,8 +120,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -119,8 +127,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { Void result = apiInstance.createUsersWithListInput(body); System.out.println(result); @@ -136,6 +147,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type [**Void**](.md) @@ -146,8 +158,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **deleteUser** @@ -164,8 +177,11 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be deleted + +String username = Arrays.asList("username_example"); // String | The name that needs to be deleted + try { Void result = apiInstance.deleteUser(username); System.out.println(result); @@ -179,7 +195,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | + **username** | [**String**](.md)| The name that needs to be deleted | + ### Return type @@ -192,7 +209,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getUserByName** @@ -200,8 +218,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -209,8 +225,11 @@ Get user by user name //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. + +String username = Arrays.asList("username_example"); // String | The name that needs to be fetched. Use user1 for testing. + try { User result = apiInstance.getUserByName(username); System.out.println(result); @@ -224,7 +243,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + **username** | [**String**](.md)| The name that needs to be fetched. Use user1 for testing. | + ### Return type @@ -239,14 +259,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **loginUser** > String loginUser(username, password) Logs user into the system - - ### Example ```java // Import classes: @@ -254,9 +273,13 @@ Logs user into the system //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 + +String username = Arrays.asList("username_example"); // String | The user name for login + +String password = Arrays.asList("password_example"); // String | The password for login in clear text + try { String result = apiInstance.loginUser(username, password); System.out.println(result); @@ -270,8 +293,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | + **username** | [**String**](.md)| The user name for login | + **password** | [**String**](.md)| The password for login in clear text | + ### Return type @@ -286,14 +310,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **logoutUser** > Void logoutUser() Logs out current logged in user session - - ### Example ```java // Import classes: @@ -301,7 +324,9 @@ Logs out current logged in user session //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); + try { Void result = apiInstance.logoutUser(); System.out.println(result); @@ -314,6 +339,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type [**Void**](.md) @@ -325,11 +351,12 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updateUser** -> Void updateUser(username, body) +> Void updateUser(user, username) Updated user @@ -342,11 +369,15 @@ This can only be done by the logged in user. //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 + +User user = ; // User | Updated user object + +String username = Arrays.asList("username_example"); // String | name that need to be deleted + try { - Void result = apiInstance.updateUser(username, body); + Void result = apiInstance.updateUser(user, username); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); @@ -358,8 +389,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](.md)| Updated user object | + **username** | [**String**](.md)| name that need to be deleted | + ### Return type @@ -371,6 +403,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + + diff --git a/samples/client/petstore/java/retrofit2/git_push.sh b/samples/client/petstore/java/retrofit2/git_push.sh index ae01b182ae9..ed374619b13 100644 --- a/samples/client/petstore/java/retrofit2/git_push.sh +++ b/samples/client/petstore/java/retrofit2/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 credential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential 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/retrofit2/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/retrofit2/gradle/wrapper/gradle-wrapper.jar index 2c6137b8789..e69de29bb2d 100644 Binary files a/samples/client/petstore/java/retrofit2/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/retrofit2/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/retrofit2/pom.xml b/samples/client/petstore/java/retrofit2/pom.xml index 047ce41dd0d..d69382c045f 100644 --- a/samples/client/petstore/java/retrofit2/pom.xml +++ b/samples/client/petstore/java/retrofit2/pom.xml @@ -1,249 +1,243 @@ - 4.0.0 - io.swagger - swagger-petstore-retrofit2 - jar - swagger-petstore-retrofit2 - 1.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-petstore-retrofit2 + jar + swagger-petstore-retrofit2 + 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 - 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 + - - - 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 - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - 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.2 - - - - jar - test-jar - - - - - - + + + + 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.codehaus.mojo - build-helper-maven-plugin - 1.10 - - - 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-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + 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-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} - - - com.squareup.retrofit2 - converter-gson - ${retrofit-version} - - - com.squareup.retrofit2 - retrofit - ${retrofit-version} - - - com.squareup.retrofit2 - converter-scalars - ${retrofit-version} - - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - ${oltu-version} - - - io.gsonfire - gson-fire - ${gson-fire-version} - - - org.threeten - threetenbp - ${threetenbp-version} - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + io.swagger + swagger-annotations + ${swagger-core-version} + + + com.squareup.retrofit2 + converter-gson + ${retrofit-version} + + + com.squareup.retrofit2 + retrofit + ${retrofit-version} + + + com.squareup.retrofit2 + converter-scalars + ${retrofit-version} + + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + ${oltu-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + + + org.threeten + threetenbp + ${threetenbp-version} + + + + + + + - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.7 - ${java.version} - ${java.version} - 1.8.0 - 1.5.15 - 2.3.0 - 1.3.5 - 1.0.1 - 4.12 - + + + junit + junit + ${junit-version} + test + + + + UTF-8 + 1.7 + ${java.version} + ${java.version} + 1.8.0 + 1.5.15 + + 2.3.0 + + + + + 1.3.5 + + 1.0.2 + 4.12 + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/ApiClient.java index d1a5c2102a8..95ba05d8fab 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/ApiClient.java @@ -9,9 +9,14 @@ import okhttp3.ResponseBody; import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; + + import org.threeten.bp.format.DateTimeFormatter; + import retrofit2.Converter; import retrofit2.Retrofit; + + import retrofit2.converter.gson.GsonConverterFactory; import retrofit2.converter.scalars.ScalarsConverterFactory; import io.swagger.client.auth.HttpBasicAuth; @@ -24,6 +29,7 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.text.DateFormat; + import java.util.LinkedHashMap; import java.util.Map; import java.util.HashMap; @@ -43,20 +49,39 @@ public ApiClient() { public ApiClient(String[] authNames) { this(); for(String authName : authNames) { + Interceptor auth; if ("api_key".equals(authName)) { + + auth = new ApiKeyAuth("header", "api_key"); + + } else if ("api_key_query".equals(authName)) { + + auth = new ApiKeyAuth("query", "api_key_query"); + + } else if ("http_basic_test".equals(authName)) { + auth = new HttpBasicAuth(); + + + } else if ("petstore_auth".equals(authName)) { - auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); + + + + auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", ""); + } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } addAuthorization(authName, auth); + + } } @@ -117,6 +142,7 @@ public void createDefaultAdapter() { adapterBuilder = new Retrofit .Builder() .baseUrl(baseUrl) + .addConverterFactory(ScalarsConverterFactory.create()) .addConverterFactory(GsonCustomConverterFactory.create(json.getGson())); } @@ -138,6 +164,8 @@ public ApiClient setSqlDateFormat(DateFormat dateFormat) { return this; } + + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { this.json.setOffsetDateTimeFormat(dateFormat); return this; @@ -148,6 +176,7 @@ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { return this; } + /** * Helper method to configure the first api key found 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..1f72d74749f 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 @@ -23,10 +23,13 @@ import com.google.gson.JsonElement; import io.gsonfire.GsonFireBuilder; import io.gsonfire.TypeSelector; + + import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import org.threeten.bp.format.DateTimeFormatter; + import io.swagger.client.model.*; import java.io.IOException; @@ -35,6 +38,7 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; + import java.util.Date; import java.util.Map; import java.util.HashMap; @@ -43,23 +47,31 @@ public class JSON { private Gson gson; private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + + private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + public static GsonBuilder createGson() { GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(Animal.class, new TypeSelector() { @Override public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Cat".toUpperCase(), Cat.class); + classByDiscriminatorValue.put("Dog".toUpperCase(), Dog.class); + classByDiscriminatorValue.put("Animal".toUpperCase(), Animal.class); return getClassByDiscriminator( classByDiscriminatorValue, - getDiscriminatorValue(readElement, "className")); + getDiscriminatorValue(readElement, "Discriminator{propertyName='className', mapping=null}")); } }) + ; return fireBuilder.createGsonBuilder(); } @@ -84,8 +96,11 @@ public JSON() { gson = createGson() .registerTypeAdapter(Date.class, dateTypeAdapter) .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) + + .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) + .create(); } @@ -109,6 +124,8 @@ public JSON setGson(Gson gson) { return this; } + + /** * Gson TypeAdapter for JSR310 OffsetDateTime type */ @@ -204,6 +221,7 @@ public JSON setLocalDateFormat(DateTimeFormatter dateFormat) { return this; } + /** * Gson TypeAdapter for java.sql.Date type * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used 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 dd5886b3bdd..f448749fee4 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 @@ -2,7 +2,11 @@ import io.swagger.client.CollectionFormats.*; + + + import retrofit2.Call; + import retrofit2.http.*; import okhttp3.RequestBody; @@ -10,24 +14,41 @@ import io.swagger.client.model.Client; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + 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({ "Content-Type:application/json" }) + + + @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 8842354c81f..50c317446b0 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 @@ -2,7 +2,11 @@ import io.swagger.client.CollectionFormats.*; + + + import retrofit2.Call; + import retrofit2.http.*; import okhttp3.RequestBody; @@ -10,143 +14,255 @@ 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 java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public interface FakeApi { + /** * * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Call<Boolean> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("fake/outer/boolean") Call fakeOuterBooleanSerialize( @retrofit2.http.Body Boolean body ); + /** * * 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> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("fake/outer/composite") Call fakeOuterCompositeSerialize( - @retrofit2.http.Body OuterComposite body + @retrofit2.http.Body OuterComposite outercomposite ); + /** * * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return Call<BigDecimal> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("fake/outer/number") Call fakeOuterNumberSerialize( @retrofit2.http.Body BigDecimal body ); + /** * * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return Call<String> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("fake/outer/string") Call fakeOuterStringSerialize( @retrofit2.http.Body String body ); + /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + + * @param client client model (required) + * @return Call<Client> + */ + + + + @Headers({ "Content-Type:application/json" }) + + + @PATCH("fake") Call testClientModel( - @retrofit2.http.Body Client body + @retrofit2.http.Body Client client ); + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) + + * @param body (required) + * @return Call<Void> + */ - @retrofit2.http.FormUrlEncoded + + + + + @Headers({ + "Content-Type:application/json; charset=utf-8" + }) + + + + + @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.Body Object body ); + /** * 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 body (optional) + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + + * @param enumHeaderString Header parameter enum test (string) (optional) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + + * @param enumQueryString Query parameter enum test (string) (optional) + * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) + * @return Call<Void> + */ - @retrofit2.http.FormUrlEncoded + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @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.Body Object body, @retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Path("enum_query_string_array") List enumQueryStringArray, @retrofit2.http.Path("enum_query_string") String enumQueryString, @retrofit2.http.Path("enum_query_integer") Integer enumQueryInteger ); + /** * test inline additionalProperties * - * @param param request body (required) + + * @param body request body (required) + * @return Call<Void> + */ + + + + @Headers({ "Content-Type:application/json" }) + + + @POST("fake/inline-additionalProperties") Call testInlineAdditionalProperties( - @retrofit2.http.Body Object param + @retrofit2.http.Body Map body ); + /** * test json serialization of form data * - * @param param field1 (required) - * @param param2 field2 (required) + + * @param body (required) + * @return Call<Void> + */ - @retrofit2.http.FormUrlEncoded + + + + + @Headers({ + "Content-Type:application/json" + }) + + + @GET("fake/jsonFormData") Call testJsonFormData( - @retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2 + @retrofit2.http.Body Object body ); + } + 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 c31c31c9233..dd876da8434 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 @@ -2,7 +2,11 @@ import io.swagger.client.CollectionFormats.*; + + + import retrofit2.Call; + import retrofit2.http.*; import okhttp3.RequestBody; @@ -10,24 +14,41 @@ import io.swagger.client.model.Client; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public interface FakeClassnameTags123Api { + /** * To test class name in snake case * - * @param body client model (required) + + * @param client client model (required) + * @return Call<Client> + */ + + + + @Headers({ "Content-Type:application/json" }) + + + @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 8d48189ce93..2769a4f2d5f 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 @@ -2,121 +2,209 @@ import io.swagger.client.CollectionFormats.*; + + + import retrofit2.Call; + import retrofit2.http.*; import okhttp3.RequestBody; import okhttp3.ResponseBody; -import java.io.File; import io.swagger.client.model.ModelApiResponse; import io.swagger.client.model.Pet; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + 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({ "Content-Type:application/json" }) + + + + + @POST("pet") Call addPet( - @retrofit2.http.Body Pet body + @retrofit2.http.Body Pet pet ); + /** * Deletes a pet * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Call<Void> + */ + + + + @DELETE("pet/{petId}") Call deletePet( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Header("api_key") String apiKey + @retrofit2.http.Path("petId") Integer petId, @retrofit2.http.Header("api_key") String apiKey ); + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @return Call<List<Pet>> + */ + + + + @GET("pet/findByStatus") Call> findPetsByStatus( - @retrofit2.http.Query("status") CSVParams status + @retrofit2.http.Path("status") List status ); + /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @return Call<List<Pet>> + */ + + + + @GET("pet/findByTags") Call> findPetsByTags( - @retrofit2.http.Query("tags") CSVParams tags + @retrofit2.http.Path("tags") List tags ); + /** * Find pet by ID * Returns a single pet + * @param petId ID of pet to return (required) + * @return Call<Pet> + */ + + + + @GET("pet/{petId}") Call getPetById( - @retrofit2.http.Path("petId") Long petId + @retrofit2.http.Path("petId") Integer petId ); + /** * 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({ "Content-Type:application/json" }) + + + + + @PUT("pet") Call updatePet( - @retrofit2.http.Body Pet body + @retrofit2.http.Body Pet pet ); + /** * Updates a pet in the store with form data * + * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) + + * @param body (optional) + * @return Call<Void> + */ - @retrofit2.http.FormUrlEncoded + + + + + @Headers({ + "Content-Type:application/x-www-form-urlencoded" + }) + + + @POST("pet/{petId}") Call updatePetWithForm( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Field("name") String name, @retrofit2.http.Field("status") String status + @retrofit2.http.Path("petId") Integer petId, @retrofit2.http.Body Object body ); + /** * uploads an image * + * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) + + * @param body (optional) + * @return Call<ModelApiResponse> + */ - @retrofit2.http.Multipart + + + + @POST("pet/{petId}/uploadImage") Call uploadFile( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part("file\"; filename=\"file") RequestBody file + @retrofit2.http.Path("petId") Integer petId, @retrofit2.http.Body Object body ); + } + 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 99367e1a0c3..f78b5841c1b 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 @@ -2,7 +2,11 @@ import io.swagger.client.CollectionFormats.*; + + + import retrofit2.Call; + import retrofit2.http.*; import okhttp3.RequestBody; @@ -10,52 +14,95 @@ import io.swagger.client.model.Order; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public interface StoreApi { + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @return Call<Void> + */ + + + + @DELETE("store/order/{order_id}") Call deleteOrder( @retrofit2.http.Path("order_id") String orderId ); + /** * Returns pet inventories by status * Returns a map of status codes to quantities + * @return Call<Map<String, Integer>> + */ + + + + @GET("store/inventory") Call> getInventory(); + /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @return Call<Order> + */ + + + + @GET("store/order/{order_id}") Call getOrderById( - @retrofit2.http.Path("order_id") Long orderId + @retrofit2.http.Path("order_id") Integer orderId ); + /** * 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> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @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 ab2074c4e80..7e19856a99a 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 @@ -2,7 +2,11 @@ import io.swagger.client.CollectionFormats.*; + + + import retrofit2.Call; + import retrofit2.http.*; import okhttp3.RequestBody; @@ -10,98 +14,193 @@ import io.swagger.client.model.User; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + 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> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @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) + * @return Call<Void> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("user/createWithArray") Call createUsersWithArrayInput( @retrofit2.http.Body List body ); + /** * Creates list of users with given input array * + * @param body List of user object (required) + * @return Call<Void> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("user/createWithList") Call createUsersWithListInput( @retrofit2.http.Body List body ); + /** * Delete user * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @return Call<Void> + */ + + + + @DELETE("user/{username}") Call deleteUser( @retrofit2.http.Path("username") String username ); + /** * Get user by user name * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return Call<User> + */ + + + + @GET("user/{username}") Call getUserByName( @retrofit2.http.Path("username") String username ); + /** * Logs user into the system * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return Call<String> + */ + + + + @GET("user/login") Call loginUser( - @retrofit2.http.Query("username") String username, @retrofit2.http.Query("password") String password + @retrofit2.http.Path("username") String username, @retrofit2.http.Path("password") String password ); + /** * Logs out current logged in user session * + * @return Call<Void> + */ + + + + @GET("user/logout") Call logoutUser(); + /** * Updated user * This can only be done by the logged in user. + + * @param user Updated user object (required) + * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @return Call<Void> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @PUT("user/{username}") Call updateUser( - @retrofit2.http.Path("username") String username, @retrofit2.http.Body User body + @retrofit2.http.Body User user, @retrofit2.http.Path("username") String username ); + } + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/auth/OAuthOkHttpClient.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/auth/OAuthOkHttpClient.java index c9b6e124d51..ab5acf4cc53 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/auth/OAuthOkHttpClient.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/auth/OAuthOkHttpClient.java @@ -59,6 +59,7 @@ public T execute(OAuthClientRequest request, Map response.body().string(), response.body().contentType().toString(), response.code(), + response.headers().toMultimap(), responseClass); } catch (IOException e) { throw new OAuthSystemException(e); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index b302fdf6012..56510d9ad3c 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -31,65 +31,63 @@ */ public class AdditionalPropertiesClass { - @SerializedName("map_property") +@SerializedName("map_property") private Map mapProperty = null; - @SerializedName("map_of_map_property") private Map> mapOfMapProperty = null; - + public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; return this; } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { this.mapProperty = new HashMap(); } + this.mapProperty.put(key, mapPropertyItem); return this; } - - /** - * Get mapProperty - * @return mapProperty + /** + * Get mapProperty + * @return mapProperty **/ @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } - public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } - + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; return this; } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { this.mapOfMapProperty = new HashMap>(); } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } - - /** - * Get mapOfMapProperty - * @return mapOfMapProperty + /** + * Get mapOfMapProperty + * @return mapOfMapProperty **/ @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -107,8 +105,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapProperty, mapOfMapProperty); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -131,5 +128,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Animal.java index f65c5bffcb3..7d0184c4016 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Animal.java @@ -29,49 +29,47 @@ public class Animal { - @SerializedName("className") +@SerializedName("className") private String className = null; - @SerializedName("color") private String color = "red"; - + public Animal className(String className) { this.className = className; return this; } - /** - * Get className - * @return className + + /** + * Get className + * @return className **/ @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } - public void setClassName(String className) { this.className = className; } - + public Animal color(String color) { this.color = color; return this; } - /** - * Get color - * @return color + + /** + * Get color + * @return color **/ @ApiModelProperty(value = "") public String getColor() { return color; } - public void setColor(String color) { this.color = color; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -89,8 +87,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(className, color); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -113,5 +110,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AnimalFarm.java deleted file mode 100644 index 0b1d6a74cc6..00000000000 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/AnimalFarm.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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 io.swagger.client.model.Animal; -import java.util.ArrayList; -import java.util.List; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index f9956fe46d8..6072a884b8b 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -31,36 +31,36 @@ */ public class ArrayOfArrayOfNumberOnly { - @SerializedName("ArrayArrayNumber") +@SerializedName("ArrayArrayNumber") private List> arrayArrayNumber = null; - + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; return this; } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { this.arrayArrayNumber = new ArrayList>(); } + this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber **/ @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } - public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -77,8 +77,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayArrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,5 +99,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index c79610d1c66..9d03a82a520 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -31,36 +31,36 @@ */ public class ArrayOfNumberOnly { - @SerializedName("ArrayNumber") +@SerializedName("ArrayNumber") private List arrayNumber = null; - + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; return this; } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { this.arrayNumber = new ArrayList(); } + this.arrayNumber.add(arrayNumberItem); return this; } - - /** - * Get arrayNumber - * @return arrayNumber + + /** + * Get arrayNumber + * @return arrayNumber **/ @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } - public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -77,8 +77,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,5 +99,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java index 747182e792e..16a6ebcc6f0 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ArrayTest.java @@ -31,94 +31,94 @@ */ public class ArrayTest { - @SerializedName("array_of_string") +@SerializedName("array_of_string") private List arrayOfString = null; - @SerializedName("array_array_of_integer") private List> arrayArrayOfInteger = null; - @SerializedName("array_array_of_model") private List> arrayArrayOfModel = null; - + public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; return this; } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { this.arrayOfString = new ArrayList(); } + this.arrayOfString.add(arrayOfStringItem); return this; } - - /** - * Get arrayOfString - * @return arrayOfString + + /** + * Get arrayOfString + * @return arrayOfString **/ @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } - public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } - + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { this.arrayArrayOfInteger = new ArrayList>(); } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger **/ @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } - + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { this.arrayArrayOfModel = new ArrayList>(); } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel **/ @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } - public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -137,8 +137,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -162,5 +161,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Capitalization.java index 00c564ab727..2c7727d7261 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Capitalization.java @@ -28,133 +28,127 @@ */ public class Capitalization { - @SerializedName("smallCamel") +@SerializedName("smallCamel") private String smallCamel = null; - @SerializedName("CapitalCamel") private String capitalCamel = null; - @SerializedName("small_Snake") private String smallSnake = null; - @SerializedName("Capital_Snake") private String capitalSnake = null; - @SerializedName("SCA_ETH_Flow_Points") private String scAETHFlowPoints = null; - @SerializedName("ATT_NAME") private String ATT_NAME = null; - + public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; return this; } - /** - * Get smallCamel - * @return smallCamel + + /** + * Get smallCamel + * @return smallCamel **/ @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } - public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } - + public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; return this; } - /** - * Get capitalCamel - * @return capitalCamel + + /** + * Get capitalCamel + * @return capitalCamel **/ @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } - public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } - + public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; return this; } - /** - * Get smallSnake - * @return smallSnake + + /** + * Get smallSnake + * @return smallSnake **/ @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } - public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } - + public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; return this; } - /** - * Get capitalSnake - * @return capitalSnake + + /** + * Get capitalSnake + * @return capitalSnake **/ @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } - public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } - + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; return this; } - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints **/ @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } - public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } - + public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; return this; } - /** - * Name of the pet - * @return ATT_NAME + + /** + * Name of the pet + * @return ATT_NAME **/ @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } - public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -176,8 +170,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -204,5 +197,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java index 64d3fbdc7fe..b093e138ba6 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Cat.java @@ -29,28 +29,67 @@ */ public class Cat extends Animal { +@SerializedName("className") + private String className = null; + @SerializedName("color") + private String color = "red"; @SerializedName("declawed") private Boolean declawed = null; + + public Cat className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Cat color(String color) { + this.color = color; + return this; + } + + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; } - /** - * Get declawed - * @return declawed + + /** + * Get declawed + * @return declawed **/ @ApiModelProperty(value = "") public Boolean isDeclawed() { return declawed; } - public void setDeclawed(Boolean declawed) { this.declawed = declawed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -60,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && + return Objects.equals(this.className, cat.className) && + Objects.equals(this.color, cat.color) && + Objects.equals(this.declawed, cat.declawed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(declawed, super.hashCode()); + return Objects.hash(className, color, declawed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); sb.append("}"); return sb.toString(); @@ -91,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Category.java index 4e9f8f56e5e..42e198faaff 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Category.java @@ -28,49 +28,47 @@ */ public class Category { - @SerializedName("id") +@SerializedName("id") private Long id = null; - @SerializedName("name") private String name = null; - + public Category id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Category name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -88,8 +86,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -112,5 +109,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ClassModel.java index 4cf0a053250..627c102a69a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ClassModel.java @@ -25,32 +25,30 @@ /** * Model for testing model with \"_class\" property - */ -@ApiModel(description = "Model for testing model with \"_class\" property") + */@ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @SerializedName("_class") +@SerializedName("_class") private String propertyClass = null; - + public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,8 +65,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -90,5 +87,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Client.java index 43b20dce8da..460c9e52ba1 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Client.java @@ -28,28 +28,27 @@ */ public class Client { - @SerializedName("client") +@SerializedName("client") private String client = null; - + public Client client(String client) { this.client = client; return this; } - /** - * Get client - * @return client + + /** + * Get client + * @return client **/ @ApiModelProperty(value = "") public String getClient() { return client; } - public void setClient(String client) { this.client = client; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -66,8 +65,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(client); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,5 +87,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Dog.java index 8fad06d9835..4d52b28512f 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Dog.java @@ -29,28 +29,67 @@ */ public class Dog extends Animal { +@SerializedName("className") + private String className = null; + @SerializedName("color") + private String color = "red"; @SerializedName("breed") private String breed = null; + + public Dog className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Dog color(String color) { + this.color = color; + return this; + } + + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Dog breed(String breed) { this.breed = breed; return this; } - /** - * Get breed - * @return breed + + /** + * Get breed + * @return breed **/ @ApiModelProperty(value = "") public String getBreed() { return breed; } - public void setBreed(String breed) { this.breed = breed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -60,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && + return Objects.equals(this.className, dog.className) && + Objects.equals(this.color, dog.color) && + Objects.equals(this.breed, dog.breed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(breed, super.hashCode()); + return Objects.hash(className, color, breed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); sb.append("}"); return sb.toString(); @@ -91,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumArrays.java index 5f063c2ec38..43000487324 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumArrays.java @@ -30,13 +30,14 @@ */ public class EnumArrays { - /** + + /** * Gets or Sets justSymbol */ @JsonAdapter(JustSymbolEnum.Adapter.class) public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), + GREATER_THAN_OR_EQUAL_TO(">="), DOLLAR("$"); private String value; @@ -44,7 +45,7 @@ public enum JustSymbolEnum { JustSymbolEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -53,7 +54,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static JustSymbolEnum fromValue(String text) { for (JustSymbolEnum b : JustSymbolEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -62,7 +63,7 @@ public static JustSymbolEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final JustSymbolEnum enumeration) throws IOException { @@ -76,17 +77,18 @@ public JustSymbolEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("just_symbol") private JustSymbolEnum justSymbol = null; - - /** + + + /** * Gets or Sets arrayEnum */ @JsonAdapter(ArrayEnumEnum.Adapter.class) public enum ArrayEnumEnum { - FISH("fish"), + FISH("fish"), CRAB("crab"); private String value; @@ -94,7 +96,7 @@ public enum ArrayEnumEnum { ArrayEnumEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -103,7 +105,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static ArrayEnumEnum fromValue(String text) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -112,7 +114,7 @@ public static ArrayEnumEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final ArrayEnumEnum enumeration) throws IOException { @@ -126,55 +128,54 @@ public ArrayEnumEnum read(final JsonReader jsonReader) throws IOException { } } } - @SerializedName("array_enum") private List arrayEnum = null; - + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; return this; } - /** - * Get justSymbol - * @return justSymbol + + /** + * Get justSymbol + * @return justSymbol **/ @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } - public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } - + public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; return this; } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { this.arrayEnum = new ArrayList(); } + this.arrayEnum.add(arrayEnumItem); return this; } - - /** - * Get arrayEnum - * @return arrayEnum + + /** + * Get arrayEnum + * @return arrayEnum **/ @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } - public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -192,8 +193,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -216,5 +216,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumClass.java index 3c19333c1ce..80a5d20a545 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumClass.java @@ -16,16 +16,21 @@ import java.util.Objects; import com.google.gson.annotations.SerializedName; + + import java.io.IOException; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; + /** * Gets or Sets EnumClass */ + @JsonAdapter(EnumClass.Adapter.class) + public enum EnumClass { _ABC("_abc"), @@ -40,6 +45,7 @@ public enum EnumClass { this.value = value; } + public String getValue() { return value; } @@ -49,6 +55,7 @@ public String toString() { return String.valueOf(value); } + public static EnumClass fromValue(String text) { for (EnumClass b : EnumClass.values()) { if (String.valueOf(b.value).equals(text)) { @@ -58,6 +65,7 @@ public static EnumClass fromValue(String text) { return null; } + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final EnumClass enumeration) throws IOException { @@ -70,5 +78,8 @@ public EnumClass read(final JsonReader jsonReader) throws IOException { return EnumClass.fromValue(String.valueOf(value)); } } + } + + 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 fb20599a85c..4ca2772ab1b 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 @@ -29,15 +29,15 @@ */ public class EnumTest { - /** + + /** * Gets or Sets enumString */ @JsonAdapter(EnumStringEnum.Adapter.class) public enum EnumStringEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"), - EMPTY(""); private String value; @@ -45,7 +45,7 @@ public enum EnumStringEnum { EnumStringEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -54,7 +54,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static EnumStringEnum fromValue(String text) { for (EnumStringEnum b : EnumStringEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -63,7 +63,7 @@ public static EnumStringEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final EnumStringEnum enumeration) throws IOException { @@ -77,17 +77,17 @@ public EnumStringEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("enum_string") private EnumStringEnum enumString = null; - - /** + + /** * Gets or Sets enumInteger */ @JsonAdapter(EnumIntegerEnum.Adapter.class) public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(1), NUMBER_MINUS_1(-1); private Integer value; @@ -95,7 +95,7 @@ public enum EnumIntegerEnum { EnumIntegerEnum(Integer value) { this.value = value; } - + public Integer getValue() { return value; } @@ -104,7 +104,7 @@ public Integer getValue() { public String toString() { return String.valueOf(value); } - + public static EnumIntegerEnum fromValue(String text) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -113,7 +113,7 @@ public static EnumIntegerEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final EnumIntegerEnum enumeration) throws IOException { @@ -127,17 +127,17 @@ public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("enum_integer") private EnumIntegerEnum enumInteger = null; - - /** + + /** * Gets or Sets enumNumber */ @JsonAdapter(EnumNumberEnum.Adapter.class) public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(1.1), NUMBER_MINUS_1_DOT_2(-1.2); private Double value; @@ -145,7 +145,7 @@ public enum EnumNumberEnum { EnumNumberEnum(Double value) { this.value = value; } - + public Double getValue() { return value; } @@ -154,7 +154,7 @@ public Double getValue() { public String toString() { return String.valueOf(value); } - + public static EnumNumberEnum fromValue(String text) { for (EnumNumberEnum b : EnumNumberEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -163,7 +163,7 @@ public static EnumNumberEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final EnumNumberEnum enumeration) throws IOException { @@ -177,86 +177,84 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("enum_number") private EnumNumberEnum enumNumber = null; - @SerializedName("outerEnum") private OuterEnum outerEnum = null; - + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; } - /** - * Get enumString - * @return enumString + + /** + * Get enumString + * @return enumString **/ @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } - public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } - + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; } - /** - * Get enumInteger - * @return enumInteger + + /** + * Get enumInteger + * @return enumInteger **/ @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } - public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } - + public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; return this; } - /** - * Get enumNumber - * @return enumNumber + + /** + * Get enumNumber + * @return enumNumber **/ @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } - public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - + public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; return this; } - /** - * Get outerEnum - * @return outerEnum + + /** + * Get outerEnum + * @return outerEnum **/ @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -276,8 +274,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -302,5 +299,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\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 ddb80771fda..9979fcd8cc3 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 @@ -32,290 +32,271 @@ */ public class FormatTest { - @SerializedName("integer") +@SerializedName("integer") private Integer integer = null; - @SerializedName("int32") private Integer int32 = null; - @SerializedName("int64") private Long int64 = null; - @SerializedName("number") private BigDecimal number = null; - @SerializedName("float") private Float _float = null; - @SerializedName("double") private Double _double = null; - @SerializedName("string") private String string = null; - @SerializedName("byte") - private byte[] _byte = null; - + private String _byte = null; @SerializedName("binary") - private byte[] binary = null; - + private String binary = null; @SerializedName("date") private LocalDate date = null; - @SerializedName("dateTime") private OffsetDateTime dateTime = null; - @SerializedName("uuid") private UUID uuid = null; - @SerializedName("password") private String password = null; - + public FormatTest integer(Integer integer) { this.integer = integer; return this; } - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer **/ @ApiModelProperty(value = "") public Integer getInteger() { return integer; } - public void setInteger(Integer integer) { this.integer = integer; } - + public FormatTest int32(Integer int32) { this.int32 = int32; return this; } - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 **/ @ApiModelProperty(value = "") public Integer getInt32() { return int32; } - public void setInt32(Integer int32) { this.int32 = int32; } - + public FormatTest int64(Long int64) { this.int64 = int64; return this; } - /** - * Get int64 - * @return int64 + + /** + * Get int64 + * @return int64 **/ @ApiModelProperty(value = "") public Long getInt64() { return int64; } - public void setInt64(Long int64) { this.int64 = int64; } - + public FormatTest number(BigDecimal number) { this.number = number; return this; } - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number + + /** + * Get number + * @return number **/ @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } - public void setNumber(BigDecimal number) { this.number = number; } - + public FormatTest _float(Float _float) { this._float = _float; return this; } - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float + + /** + * Get _float + * @return _float **/ @ApiModelProperty(value = "") public Float getFloat() { return _float; } - public void setFloat(Float _float) { this._float = _float; } - + public FormatTest _double(Double _double) { this._double = _double; return this; } - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double + + /** + * Get _double + * @return _double **/ @ApiModelProperty(value = "") public Double getDouble() { return _double; } - public void setDouble(Double _double) { this._double = _double; } - + public FormatTest string(String string) { this.string = string; return this; } - /** - * Get string - * @return string + + /** + * Get string + * @return string **/ @ApiModelProperty(value = "") public String getString() { return string; } - public void setString(String string) { this.string = string; } - - public FormatTest _byte(byte[] _byte) { + + public FormatTest _byte(String _byte) { this._byte = _byte; return this; } - /** - * Get _byte - * @return _byte + + /** + * Get _byte + * @return _byte **/ @ApiModelProperty(required = true, value = "") - public byte[] getByte() { + public String getByte() { return _byte; } - - public void setByte(byte[] _byte) { + public void setByte(String _byte) { this._byte = _byte; } - - public FormatTest binary(byte[] binary) { + + public FormatTest binary(String binary) { this.binary = binary; return this; } - /** - * Get binary - * @return binary + + /** + * Get binary + * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public String getBinary() { return binary; } - - public void setBinary(byte[] binary) { + public void setBinary(String binary) { this.binary = binary; } - + public FormatTest date(LocalDate date) { this.date = date; return this; } - /** - * Get date - * @return date + + /** + * Get date + * @return date **/ @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } - public void setDate(LocalDate date) { this.date = date; } - + public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public FormatTest password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -344,8 +325,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -379,5 +359,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 1b7ff181941..ddb6837fecb 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -28,31 +28,31 @@ */ public class HasOnlyReadOnly { - @SerializedName("bar") +@SerializedName("bar") private String bar = null; - @SerializedName("foo") private String foo = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - - /** - * Get foo - * @return foo + + + /** + * Get foo + * @return foo **/ @ApiModelProperty(value = "") public String getFoo() { return foo; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,8 +70,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, foo); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -94,5 +93,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java index a791e68d8fb..29e18228896 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MapTest.java @@ -31,16 +31,17 @@ */ public class MapTest { - @SerializedName("map_map_of_string") +@SerializedName("map_map_of_string") private Map> mapMapOfString = null; - - /** + + + /** * Gets or Sets inner */ @JsonAdapter(InnerEnum.Adapter.class) public enum InnerEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"); private String value; @@ -48,7 +49,7 @@ public enum InnerEnum { InnerEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -57,7 +58,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static InnerEnum fromValue(String text) { for (InnerEnum b : InnerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -66,7 +67,7 @@ public static InnerEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final InnerEnum enumeration) throws IOException { @@ -80,63 +81,61 @@ public InnerEnum read(final JsonReader jsonReader) throws IOException { } } } - @SerializedName("map_of_enum_string") private Map mapOfEnumString = null; - + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { this.mapMapOfString = new HashMap>(); } + this.mapMapOfString.put(key, mapMapOfStringItem); return this; } - - /** - * Get mapMapOfString - * @return mapMapOfString + /** + * Get mapMapOfString + * @return mapMapOfString **/ @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } - public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } - + public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; return this; } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { this.mapOfEnumString = new HashMap(); } + this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } - - /** - * Get mapOfEnumString - * @return mapOfEnumString + /** + * Get mapOfEnumString + * @return mapOfEnumString **/ @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } - public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,8 +153,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -178,5 +176,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 7c99abe53eb..9efda42416f 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -34,78 +34,75 @@ */ public class MixedPropertiesAndAdditionalPropertiesClass { - @SerializedName("uuid") +@SerializedName("uuid") private UUID uuid = null; - @SerializedName("dateTime") private OffsetDateTime dateTime = null; - @SerializedName("map") private Map map = null; - + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; return this; } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { this.map = new HashMap(); } + this.map.put(key, mapItem); return this; } - - /** - * Get map - * @return map + /** + * Get map + * @return map **/ @ApiModelProperty(value = "") public Map getMap() { return map; } - public void setMap(Map map) { this.map = map; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -124,8 +121,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(uuid, dateTime, map); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -149,5 +145,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 0d39eb7eff5..66416f6c0cb 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 @@ -25,53 +25,50 @@ /** * Model for testing model name starting with number - */ -@ApiModel(description = "Model for testing model name starting with number") + */@ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @SerializedName("name") +@SerializedName("name") private Integer name = null; - @SerializedName("class") private String propertyClass = null; - + public Model200Response name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - + public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -89,8 +86,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -113,5 +109,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelApiResponse.java index 3d9352c50aa..5217ac1d2ea 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -28,70 +28,67 @@ */ public class ModelApiResponse { - @SerializedName("code") +@SerializedName("code") private Integer code = null; - @SerializedName("type") private String type = null; - @SerializedName("message") private String message = null; - + public ModelApiResponse code(Integer code) { this.code = code; return this; } - /** - * Get code - * @return code + + /** + * Get code + * @return code **/ @ApiModelProperty(value = "") public Integer getCode() { return code; } - public void setCode(Integer code) { this.code = code; } - + public ModelApiResponse type(String type) { this.type = type; return this; } - /** - * Get type - * @return type + + /** + * Get type + * @return type **/ @ApiModelProperty(value = "") public String getType() { return type; } - public void setType(String type) { this.type = type; } - + public ModelApiResponse message(String message) { this.message = message; return this; } - /** - * Get message - * @return message + + /** + * Get message + * @return message **/ @ApiModelProperty(value = "") public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,8 +107,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(code, type, message); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -135,5 +131,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelReturn.java index ab6333ff86d..21d717b8076 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelReturn.java @@ -25,32 +25,30 @@ /** * Model for testing reserved words - */ -@ApiModel(description = "Model for testing reserved words") + */@ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @SerializedName("return") +@SerializedName("return") private Integer _return = null; - + public ModelReturn _return(Integer _return) { this._return = _return; return this; } - /** - * Get _return - * @return _return + + /** + * Get _return + * @return _return **/ @ApiModelProperty(value = "") public Integer getReturn() { return _return; } - public void setReturn(Integer _return) { this._return = _return; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,8 +65,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(_return); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -90,5 +87,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 1492add2952..c631e933a60 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 @@ -25,77 +25,74 @@ /** * Model for testing model name same as property name - */ -@ApiModel(description = "Model for testing model name same as property name") + */@ApiModel(description = "Model for testing model name same as property name") public class Name { - @SerializedName("name") +@SerializedName("name") private Integer name = null; - @SerializedName("snake_case") private Integer snakeCase = null; - @SerializedName("property") private String property = null; - @SerializedName("123Number") private Integer _123Number = null; - + public Name name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - - /** - * Get snakeCase - * @return snakeCase + + + /** + * Get snakeCase + * @return snakeCase **/ @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } - + public Name property(String property) { this.property = property; return this; } - /** - * Get property - * @return property + + /** + * Get property + * @return property **/ @ApiModelProperty(value = "") public String getProperty() { return property; } - public void setProperty(String property) { this.property = property; } - - /** - * Get _123Number - * @return _123Number + + + /** + * Get _123Number + * @return _123Number **/ @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -115,8 +112,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, snakeCase, property, _123Number); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -141,5 +137,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/NumberOnly.java index b13c0536a13..0468fa26f78 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/NumberOnly.java @@ -29,28 +29,27 @@ */ public class NumberOnly { - @SerializedName("JustNumber") +@SerializedName("JustNumber") private BigDecimal justNumber = null; - + public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; return this; } - /** - * Get justNumber - * @return justNumber + + /** + * Get justNumber + * @return justNumber **/ @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } - public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,8 +66,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -90,5 +88,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java index 4dcf75a7cd0..6192a446f0a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Order.java @@ -29,27 +29,23 @@ */ public class Order { - @SerializedName("id") +@SerializedName("id") private Long id = null; - @SerializedName("petId") private Long petId = null; - @SerializedName("quantity") private Integer quantity = null; - @SerializedName("shipDate") private OffsetDateTime shipDate = null; - - /** + + /** * Order Status */ @JsonAdapter(StatusEnum.Adapter.class) public enum StatusEnum { - PLACED("placed"), + PLACED("placed"), APPROVED("approved"), - DELIVERED("delivered"); private String value; @@ -57,7 +53,7 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -66,7 +62,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -75,7 +71,7 @@ public static StatusEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { @@ -89,122 +85,120 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("status") private StatusEnum status = null; - @SerializedName("complete") private Boolean complete = false; - + public Order id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Order petId(Long petId) { this.petId = petId; return this; } - /** - * Get petId - * @return petId + + /** + * Get petId + * @return petId **/ @ApiModelProperty(value = "") public Long getPetId() { return petId; } - public void setPetId(Long petId) { this.petId = petId; } - + public Order quantity(Integer quantity) { this.quantity = quantity; return this; } - /** - * Get quantity - * @return quantity + + /** + * Get quantity + * @return quantity **/ @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } - public void setQuantity(Integer quantity) { this.quantity = quantity; } - + public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; return this; } - /** - * Get shipDate - * @return shipDate + + /** + * Get shipDate + * @return shipDate **/ @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } - public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } - + public Order status(StatusEnum status) { this.status = status; return this; } - /** - * Order Status - * @return status + + /** + * Order Status + * @return status **/ @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - + public Order complete(Boolean complete) { this.complete = complete; return this; } - /** - * Get complete - * @return complete + + /** + * Get complete + * @return complete **/ @ApiModelProperty(value = "") public Boolean isComplete() { return complete; } - public void setComplete(Boolean complete) { this.complete = complete; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -226,8 +220,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -254,5 +247,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterComposite.java index 56159fe5d93..039a870d41b 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterComposite.java @@ -29,70 +29,67 @@ */ public class OuterComposite { - @SerializedName("my_number") +@SerializedName("my_number") private BigDecimal myNumber = null; - @SerializedName("my_string") private String myString = null; - @SerializedName("my_boolean") private Boolean myBoolean = null; - + public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; return this; } - /** - * Get myNumber - * @return myNumber + + /** + * Get myNumber + * @return myNumber **/ @ApiModelProperty(value = "") public BigDecimal getMyNumber() { return myNumber; } - public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } - + public OuterComposite myString(String myString) { this.myString = myString; return this; } - /** - * Get myString - * @return myString + + /** + * Get myString + * @return myString **/ @ApiModelProperty(value = "") public String getMyString() { return myString; } - public void setMyString(String myString) { this.myString = myString; } - + public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; return this; } - /** - * Get myBoolean - * @return myBoolean + + /** + * Get myBoolean + * @return myBoolean **/ @ApiModelProperty(value = "") public Boolean getMyBoolean() { return myBoolean; } - public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -111,8 +108,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(myNumber, myString, myBoolean); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -136,5 +132,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterEnum.java index 3b24acc6b51..2bb0d8fcb27 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/OuterEnum.java @@ -16,16 +16,21 @@ import java.util.Objects; import com.google.gson.annotations.SerializedName; + + import java.io.IOException; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; + /** * Gets or Sets OuterEnum */ + @JsonAdapter(OuterEnum.Adapter.class) + public enum OuterEnum { PLACED("placed"), @@ -40,6 +45,7 @@ public enum OuterEnum { this.value = value; } + public String getValue() { return value; } @@ -49,6 +55,7 @@ public String toString() { return String.valueOf(value); } + public static OuterEnum fromValue(String text) { for (OuterEnum b : OuterEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -58,6 +65,7 @@ public static OuterEnum fromValue(String text) { return null; } + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final OuterEnum enumeration) throws IOException { @@ -70,5 +78,8 @@ public OuterEnum read(final JsonReader jsonReader) throws IOException { return OuterEnum.fromValue(String.valueOf(value)); } } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java index dac1250ac07..2b91dae9614 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Pet.java @@ -32,30 +32,25 @@ */ public class Pet { - @SerializedName("id") +@SerializedName("id") private Long id = null; - @SerializedName("category") private Category category = null; - @SerializedName("name") private String name = null; - @SerializedName("photoUrls") private List photoUrls = new ArrayList(); - @SerializedName("tags") private List tags = null; - - /** + + /** * pet status in the store */ @JsonAdapter(StatusEnum.Adapter.class) public enum StatusEnum { - AVAILABLE("available"), + AVAILABLE("available"), PENDING("pending"), - SOLD("sold"); private String value; @@ -63,7 +58,7 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -72,7 +67,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -81,7 +76,7 @@ public static StatusEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { @@ -95,132 +90,132 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("status") private StatusEnum status = null; - + public Pet id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Pet category(Category category) { this.category = category; return this; } - /** - * Get category - * @return category + + /** + * Get category + * @return category **/ @ApiModelProperty(value = "") public Category getCategory() { return category; } - public void setCategory(Category category) { this.category = category; } - + public Pet name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - + public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); return this; } - - /** - * Get photoUrls - * @return photoUrls + + /** + * Get photoUrls + * @return photoUrls **/ @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } - + public Pet tags(List tags) { this.tags = tags; return this; } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { this.tags = new ArrayList(); } + this.tags.add(tagsItem); return this; } - - /** - * Get tags - * @return tags + + /** + * Get tags + * @return tags **/ @ApiModelProperty(value = "") public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } - + public Pet status(StatusEnum status) { this.status = status; return this; } - /** - * pet status in the store - * @return status + + /** + * pet status in the store + * @return status **/ @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -242,8 +237,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -270,5 +264,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index f6e025412de..c7c8eb90968 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -28,40 +28,39 @@ */ public class ReadOnlyFirst { - @SerializedName("bar") +@SerializedName("bar") private String bar = null; - @SerializedName("baz") private String baz = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; } - /** - * Get baz - * @return baz + + /** + * Get baz + * @return baz **/ @ApiModelProperty(value = "") public String getBaz() { return baz; } - public void setBaz(String baz) { this.baz = baz; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -79,8 +78,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, baz); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -103,5 +101,8 @@ private String toIndentedString(java.lang.Object o) { 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 e743292100b..3e2312615c2 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 @@ -28,28 +28,27 @@ */ public class SpecialModelName { - @SerializedName("$special[property.name]") - private Long specialPropertyName = null; - - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; +@SerializedName("$special[property.name]") + private Long $specialPropertyName = null; + + 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; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,22 +57,21 @@ public boolean equals(java.lang.Object o) { 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); } - - + @Override public String toString() { 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(); } @@ -89,5 +87,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Tag.java index bb6de58c8a1..b032d15676a 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Tag.java @@ -28,49 +28,47 @@ */ public class Tag { - @SerializedName("id") +@SerializedName("id") private Long id = null; - @SerializedName("name") private String name = null; - + public Tag id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Tag name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -88,8 +86,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -112,5 +109,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/User.java index 4ccb8a1c147..75e44e2ff37 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/User.java @@ -28,175 +28,167 @@ */ public class User { - @SerializedName("id") +@SerializedName("id") private Long id = null; - @SerializedName("username") private String username = null; - @SerializedName("firstName") private String firstName = null; - @SerializedName("lastName") private String lastName = null; - @SerializedName("email") private String email = null; - @SerializedName("password") private String password = null; - @SerializedName("phone") private String phone = null; - @SerializedName("userStatus") private Integer userStatus = null; - + public User id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public User username(String username) { this.username = username; return this; } - /** - * Get username - * @return username + + /** + * Get username + * @return username **/ @ApiModelProperty(value = "") public String getUsername() { return username; } - public void setUsername(String username) { this.username = username; } - + public User firstName(String firstName) { this.firstName = firstName; return this; } - /** - * Get firstName - * @return firstName + + /** + * Get firstName + * @return firstName **/ @ApiModelProperty(value = "") public String getFirstName() { return firstName; } - public void setFirstName(String firstName) { this.firstName = firstName; } - + public User lastName(String lastName) { this.lastName = lastName; return this; } - /** - * Get lastName - * @return lastName + + /** + * Get lastName + * @return lastName **/ @ApiModelProperty(value = "") public String getLastName() { return lastName; } - public void setLastName(String lastName) { this.lastName = lastName; } - + public User email(String email) { this.email = email; return this; } - /** - * Get email - * @return email + + /** + * Get email + * @return email **/ @ApiModelProperty(value = "") public String getEmail() { return email; } - public void setEmail(String email) { this.email = email; } - + public User password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - + public User phone(String phone) { this.phone = phone; return this; } - /** - * Get phone - * @return phone + + /** + * Get phone + * @return phone **/ @ApiModelProperty(value = "") public String getPhone() { return phone; } - public void setPhone(String phone) { this.phone = phone; } - + public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; } - /** - * User Status - * @return userStatus + + /** + * User Status + * @return userStatus **/ @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } - public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -220,8 +212,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -250,5 +241,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..6fdc3702e80 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 @@ -2,14 +2,17 @@ import io.swagger.client.ApiClient; import io.swagger.client.model.Client; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for AnotherFakeApi */ @@ -22,6 +25,8 @@ public void setup() { api = new ApiClient().createService(AnotherFakeApi.class); } + + /** * To test special tags * @@ -29,9 +34,13 @@ public void setup() { */ @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..559492405ac 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,15 +2,19 @@ import io.swagger.client.ApiClient; import java.math.BigDecimal; -import java.util.Date; +import io.swagger.client.model.Client; +import io.swagger.client.model.OuterComposite; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for FakeApi */ @@ -24,6 +28,82 @@ public void setup() { } + + /** + * + * + * Test serialization of outer boolean types + */ + @Test + public void fakeOuterBooleanSerializeTest() { + + Boolean body = null; + + // Boolean response = api.fakeOuterBooleanSerialize(body); + + // 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 + } + + /** + * 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 假端點 偽のエンドポイント 가짜 엔드 포인트 * @@ -31,21 +111,68 @@ public void setup() { */ @Test public void testEndpointParametersTest() { - BigDecimal number = null; - Double _double = null; - String string = 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 password = null; - // Void response = api.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); + + Object body = null; + + // Void response = api.testEndpointParameters(body); + + // TODO: test validations + } + + /** + * To test enum parameters + * + * To test enum parameters + */ + @Test + public void testEnumParametersTest() { + + Object body = null; + + List enumHeaderStringArray = null; + + String enumHeaderString = null; + + List enumQueryStringArray = null; + + String enumQueryString = null; + + Integer enumQueryInteger = null; + + // Void response = api.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); // TODO: test validations } + /** + * test inline additionalProperties + * + * + */ + @Test + public void testInlineAdditionalPropertiesTest() { + + Map body = null; + + // Void response = api.testInlineAdditionalProperties(body); + + // TODO: test validations + } + + /** + * test json serialization of form data + * + * + */ + @Test + public void testJsonFormDataTest() { + + Object body = null; + + // Void response = api.testJsonFormData(body); + + // 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..ab29f7ce6af 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 @@ -2,14 +2,17 @@ import io.swagger.client.ApiClient; import io.swagger.client.model.Client; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for FakeClassnameTags123Api */ @@ -23,6 +26,7 @@ public void setup() { } + /** * To test class name in snake case * @@ -30,10 +34,13 @@ public void setup() { */ @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 bbaa0000f44..7b467b0b508 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,189 +1,158 @@ 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 java.util.ArrayList; -import java.util.Arrays; -import java.util.List; +import io.swagger.client.model.ModelApiResponse; +import io.swagger.client.model.Pet; -import org.junit.*; +import org.junit.Before; +import org.junit.Test; -import retrofit2.Response; -import okhttp3.MediaType; -import okhttp3.RequestBody; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; -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(); - - 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()); - } - - @Test - public void testUpdatePet() throws Exception { - Pet pet = createRandomPet(); - pet.setName("programmer"); + public void addPetTest() { + + Pet pet = null; + + // Void response = api.addPet(pet); - 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 } - + + /** + * Deletes a pet + * + * + */ @Test - public void testFindPetsByStatus() throws Exception { - Pet pet = createRandomPet(); - pet.setName("programmer"); - pet.setStatus(Pet.StatusEnum.AVAILABLE); - - 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); + public void deletePetTest() { + + Integer petId = null; + + String apiKey = null; + + // Void response = api.deletePet(petId, apiKey); + + // TODO: test validations } - + + /** + * Finds Pets by status + * + * Multiple status values can be provided with comma separated strings + */ @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).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); - } + 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 testUpdatePetWithForm() throws Exception { - Pet pet = createRandomPet(); - pet.setName("frank"); - api.addPet(pet).execute(); - - Pet fetched = api.getPetById(pet.getId()).execute().body(); + public void findPetsByTagsTest() { + + List tags = null; + + // List response = api.findPetsByTags(tags); - api.updatePetWithForm(fetched.getId(), "furt", null).execute(); - Pet updated = api.getPetById(fetched.getId()).execute().body(); - - assertEquals(updated.getName(), "furt"); + // TODO: test validations } - + + /** + * Find pet by ID + * + * Returns a single pet + */ @Test - public void testDeletePet() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet).execute(); + public void getPetByIdTest() { + + Integer petId = null; + + // Pet response = api.getPetById(petId); - Pet fetched = api.getPetById(pet.getId()).execute().body(); - api.deletePet(fetched.getId(), null).execute(); - - assertFalse(api.getPetById(fetched.getId()).execute().isSuccessful()); + // TODO: test validations } - + + /** + * Update an existing pet + * + * + */ @Test - public void testUploadFile() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet).execute(); + public void updatePetTest() { + + Pet pet = null; + + // Void response = api.updatePet(pet); - File file = new File("hello.txt"); - BufferedWriter writer = new BufferedWriter(new FileWriter(file)); - writer.write("Hello world!"); - writer.close(); - - api.uploadFile(pet.getId(), null, RequestBody.create(MediaType.parse("text/plain"), file)).execute(); + // TODO: test validations } - + + /** + * Updates a pet in the store with form data + * + * + */ @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()); + public void updatePetWithFormTest() { + + Integer petId = null; + + Object body = null; + + // Void response = api.updatePetWithForm(petId, body); + + // TODO: test validations } - - 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; + + /** + * uploads an image + * + * + */ + @Test + public void uploadFileTest() { + + Integer petId = null; + + Object body = null; + + // ModelApiResponse response = api.uploadFile(petId, body); + + // 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..f59141e4eed 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,89 @@ 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 java.lang.reflect.Field; -import java.util.Map; +import org.junit.Before; +import org.junit.Test; -import org.junit.*; -import org.threeten.bp.OffsetDateTime; -import retrofit2.Response; -import static org.junit.Assert.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 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; + + // Void response = 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(); - - Order fetched = api.getOrderById(order.getId()).execute().body(); - assertEquals(fetched.getId(), order.getId()); - - api.deleteOrder(String.valueOf(order.getId())).execute(); + public void getOrderByIdTest() { + + Integer orderId = null; + + // Order response = api.getOrderById(orderId); - 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..2f011d503a5 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,153 @@ 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.Arrays; +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 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(); - - api.createUser(user).execute(); + public void createUserTest() { + + User user = null; + + // Void response = api.createUser(user); - 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()); - - api.createUsersWithArrayInput(Arrays.asList(new User[]{user1, user2})).execute(); + public void createUsersWithArrayInputTest() { + + List body = null; + + // Void response = api.createUsersWithArrayInput(body); - 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 body = null; + + // Void response = api.createUsersWithListInput(body); - 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; + + // Void response = 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 getUserByNameTest() { + + String username = null; + + // User response = api.getUserByName(username); + // TODO: test validations + } + + /** + * Logs user into the system + * + * + */ @Test - public void logoutUser() throws Exception { - api.logoutUser().execute(); + 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() { + + // Void response = api.logoutUser(); - 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); - - return user; + // TODO: test validations + } + + /** + * Updated user + * + * This can only be done by the logged in user. + */ + @Test + public void updateUserTest() { + + User user = null; + + String username = null; + + // Void response = api.updateUser(user, username); + + // TODO: test validations } + + } diff --git a/samples/client/petstore/java/retrofit2rx/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit2rx/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/client/petstore/java/retrofit2rx/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/retrofit2rx/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx/README.md b/samples/client/petstore/java/retrofit2rx/README.md index a1f0b3468be..bd975063c16 100644 --- a/samples/client/petstore/java/retrofit2rx/README.md +++ b/samples/client/petstore/java/retrofit2rx/README.md @@ -32,10 +32,6 @@ 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. - ## Author apiteam@swagger.io diff --git a/samples/client/petstore/java/retrofit2rx/build.gradle b/samples/client/petstore/java/retrofit2rx/build.gradle index efbc57f9f81..b5483080f35 100644 --- a/samples/client/petstore/java/retrofit2rx/build.gradle +++ b/samples/client/petstore/java/retrofit2rx/build.gradle @@ -32,8 +32,11 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { + + sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 + } // Rename the aar correctly @@ -94,12 +97,19 @@ if(hasProperty('target') && target == 'android') { } ext { - oltu_version = "1.0.1" + oltu_version = "1.0.2" retrofit_version = "2.3.0" + swagger_annotations_version = "1.5.15" junit_version = "4.12" + rx_java_version = "1.3.0" + + + + threetenbp_version = "1.3.5" + json_fire_version = "1.8.0" } @@ -107,12 +117,19 @@ dependencies { compile "com.squareup.retrofit2:retrofit:$retrofit_version" compile "com.squareup.retrofit2:converter-scalars:$retrofit_version" compile "com.squareup.retrofit2:converter-gson:$retrofit_version" + compile "com.squareup.retrofit2:adapter-rxjava:$retrofit_version" compile "io.reactivex:rxjava:$rx_java_version" + + compile "io.swagger:swagger-annotations:$swagger_annotations_version" compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" compile "io.gsonfire:gson-fire:$json_fire_version" + + compile "org.threeten:threetenbp:$threetenbp_version" + + testCompile "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/retrofit2rx/build.sbt b/samples/client/petstore/java/retrofit2rx/build.sbt index e8748e9d2f7..a690d4eea2c 100644 --- a/samples/client/petstore/java/retrofit2rx/build.sbt +++ b/samples/client/petstore/java/retrofit2rx/build.sbt @@ -11,12 +11,21 @@ lazy val root = (project in file(".")). libraryDependencies ++= Seq( "com.squareup.retrofit2" % "retrofit" % "2.3.0" % "compile", "com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile", + "com.squareup.retrofit2" % "converter-gson" % "2.3.0" % "compile", + + + "com.squareup.retrofit2" % "adapter-rxjava" % "2.3.0" % "compile", "io.reactivex" % "rxjava" % "1.3.0" % "compile", + + "io.swagger" % "swagger-annotations" % "1.5.15" % "compile", - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2" % "compile", + + "org.threeten" % "threetenbp" % "1.3.5" % "compile", + "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" diff --git a/samples/client/petstore/java/retrofit2rx/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/retrofit2rx/docs/AdditionalPropertiesClass.md index 0437c4dd8cc..b37862da7cf 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/java/retrofit2rx/docs/AdditionalPropertiesClass.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx/docs/Animal.md b/samples/client/petstore/java/retrofit2rx/docs/Animal.md index b3f325c3524..346caaf63f4 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/Animal.md +++ b/samples/client/petstore/java/retrofit2rx/docs/Animal.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx/docs/AnimalFarm.md b/samples/client/petstore/java/retrofit2rx/docs/AnimalFarm.md deleted file mode 100644 index c7c7f1ddcce..00000000000 --- a/samples/client/petstore/java/retrofit2rx/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ - -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - diff --git a/samples/client/petstore/java/retrofit2rx/docs/AnotherFakeApi.md b/samples/client/petstore/java/retrofit2rx/docs/AnotherFakeApi.md index bcc1a3a45ce..792799b51e8 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/AnotherFakeApi.md @@ -7,9 +7,11 @@ Method | HTTP request | Description [**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** another-fake/dummy | To test special tags + + # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -22,10 +24,13 @@ To test special tags //import io.swagger.client.api.AnotherFakeApi; + AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +42,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -52,3 +58,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/retrofit2rx/docs/ArrayOfArrayOfNumberOnly.md index 77292549927..3671a5e9190 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/java/retrofit2rx/docs/ArrayOfArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/retrofit2rx/docs/ArrayOfNumberOnly.md index e8cc4cd36dc..30b9b6648f4 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/java/retrofit2rx/docs/ArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx/docs/ArrayTest.md b/samples/client/petstore/java/retrofit2rx/docs/ArrayTest.md index 9feee16427f..4ab76343030 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/ArrayTest.md +++ b/samples/client/petstore/java/retrofit2rx/docs/ArrayTest.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx/docs/Capitalization.md b/samples/client/petstore/java/retrofit2rx/docs/Capitalization.md index 0f3064c1996..9af7864f97e 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/Capitalization.md +++ b/samples/client/petstore/java/retrofit2rx/docs/Capitalization.md @@ -13,3 +13,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx/docs/Cat.md b/samples/client/petstore/java/retrofit2rx/docs/Cat.md index 6e9f71ce7dd..5e408344021 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/Cat.md +++ b/samples/client/petstore/java/retrofit2rx/docs/Cat.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **declawed** | **Boolean** | | [optional] + diff --git a/samples/client/petstore/java/retrofit2rx/docs/Category.md b/samples/client/petstore/java/retrofit2rx/docs/Category.md index e2df0803278..deb5a3e2a52 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/Category.md +++ b/samples/client/petstore/java/retrofit2rx/docs/Category.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx/docs/ClassModel.md b/samples/client/petstore/java/retrofit2rx/docs/ClassModel.md index 64f880c8786..49c281cc0ed 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/ClassModel.md +++ b/samples/client/petstore/java/retrofit2rx/docs/ClassModel.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx/docs/Client.md b/samples/client/petstore/java/retrofit2rx/docs/Client.md index 5c490ea166c..52b2f72c79c 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/Client.md +++ b/samples/client/petstore/java/retrofit2rx/docs/Client.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx/docs/Dog.md b/samples/client/petstore/java/retrofit2rx/docs/Dog.md index ac7cea323ff..00e6446e9f5 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/Dog.md +++ b/samples/client/petstore/java/retrofit2rx/docs/Dog.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **breed** | **String** | | [optional] + diff --git a/samples/client/petstore/java/retrofit2rx/docs/EnumArrays.md b/samples/client/petstore/java/retrofit2rx/docs/EnumArrays.md index 4dddc0bfd27..939a0e69587 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/EnumArrays.md +++ b/samples/client/petstore/java/retrofit2rx/docs/EnumArrays.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] + ## Enum: JustSymbolEnum Name | Value @@ -20,8 +21,6 @@ DOLLAR | "$" ## Enum: List<ArrayEnumEnum> Name | Value ---- | ----- -FISH | "fish" -CRAB | "crab" diff --git a/samples/client/petstore/java/retrofit2rx/docs/EnumTest.md b/samples/client/petstore/java/retrofit2rx/docs/EnumTest.md index 08fee344882..9722c621962 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2rx/docs/EnumTest.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] + ## Enum: EnumStringEnum Name | Value diff --git a/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md b/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md index 3e052dea273..6d1d77bdf10 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/FakeApi.md @@ -15,6 +15,8 @@ Method | HTTP request | Description [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** fake/jsonFormData | test json serialization of form data + + # **fakeOuterBooleanSerialize** > Boolean fakeOuterBooleanSerialize(body) @@ -30,8 +32,11 @@ Test serialization of outer boolean types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body + +Boolean body = ; // Boolean | Input boolean as post body + try { Boolean result = apiInstance.fakeOuterBooleanSerialize(body); System.out.println(result); @@ -47,6 +52,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + ### Return type **Boolean** @@ -57,12 +63,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outercomposite) @@ -75,10 +82,13 @@ Test serialization of object with outer number type //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body + +OuterComposite 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 +100,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outercomposite** | [**OuterComposite**](.md)| Input composite as post body | [optional] + ### Return type @@ -102,8 +113,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterNumberSerialize** @@ -120,8 +132,11 @@ Test serialization of outer number types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body + +BigDecimal body = ; // BigDecimal | Input number as post body + try { BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); System.out.println(result); @@ -137,6 +152,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + ### Return type [**BigDecimal**](BigDecimal.md) @@ -147,8 +163,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterStringSerialize** @@ -165,8 +182,11 @@ Test serialization of outer string types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String body = "body_example"; // String | Input string as post body + +String body = ; // String | Input string as post body + try { String result = apiInstance.fakeOuterStringSerialize(body); System.out.println(result); @@ -182,6 +202,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**String**](String.md)| Input string as post body | [optional] + ### Return type **String** @@ -192,12 +213,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -210,10 +232,13 @@ To test \"client\" model //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +250,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -240,9 +266,10 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + # **testEndpointParameters** -> Void testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) +> Void testEndpointParameters(body) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -251,36 +278,17 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### 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.FakeApi; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure HTTP basic authorization: http_basic_test -HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); -http_basic_test.setUsername("YOUR USERNAME"); -http_basic_test.setPassword("YOUR PASSWORD"); 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 -Integer integer = 56; // Integer | None -Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None -Float _float = 3.4F; // Float | None -String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None -LocalDate date = new LocalDate(); // LocalDate | None -OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None -String password = "password_example"; // String | None -String paramCallback = "paramCallback_example"; // String | None + +Object body = ; // Object | + try { - Void result = apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + Void result = apiInstance.testEndpointParameters(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEndpointParameters"); @@ -292,20 +300,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **BigDecimal**| None | - **_double** | **Double**| None | - **patternWithoutDelimiter** | **String**| None | - **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] - **int64** | **Long**| None | [optional] - **_float** | **Float**| None | [optional] - **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] - **date** | **LocalDate**| None | [optional] - **dateTime** | **OffsetDateTime**| None | [optional] - **password** | **String**| None | [optional] - **paramCallback** | **String**| None | [optional] + **body** | [**Object**](Object.md)| | + ### Return type @@ -318,11 +314,12 @@ Name | Type | Description | Notes ### 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 + - **Accept**: Not defined + # **testEnumParameters** -> Void testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> Void testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger) To test enum parameters @@ -335,17 +332,23 @@ To test enum parameters //import io.swagger.client.api.FakeApi; + 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) + +Object body = ; // Object | + List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) -String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + +String enumHeaderString = Arrays.asList("enumHeaderString_example"); // 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) + +String enumQueryString = Arrays.asList("enumQueryString_example"); // String | Query parameter enum test (string) + +Integer enumQueryInteger = Arrays.asList(56); // Integer | Query parameter enum test (double) + try { - Void result = apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + Void result = apiInstance.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); @@ -357,14 +360,13 @@ 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] + **body** | [**Object**](Object.md)| | [optional] + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: ] + **enumHeaderString** | [**String**](.md)| Header parameter enum test (string) | [optional] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: ] + **enumQueryString** | [**String**](.md)| Query parameter enum test (string) | [optional] + **enumQueryInteger** | [**Integer**](.md)| Query parameter enum test (double) | [optional] + ### Return type @@ -377,16 +379,15 @@ No authorization required ### HTTP request headers - **Content-Type**: */* - - **Accept**: */* + - **Accept**: Not defined + # **testInlineAdditionalProperties** -> Void testInlineAdditionalProperties(param) +> Void testInlineAdditionalProperties(body) test inline additionalProperties - - ### Example ```java // Import classes: @@ -394,10 +395,13 @@ test inline additionalProperties //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body + +Map body = ; // Map | request body + try { - Void result = apiInstance.testInlineAdditionalProperties(param); + Void result = apiInstance.testInlineAdditionalProperties(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); @@ -409,7 +413,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **body** | [**Map<String, String>**](Map.md)| request body | + ### Return type @@ -424,14 +429,13 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined + # **testJsonFormData** -> Void testJsonFormData(param, param2) +> Void testJsonFormData(body) test json serialization of form data - - ### Example ```java // Import classes: @@ -439,11 +443,13 @@ test json serialization of form data //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String param = "param_example"; // String | field1 -String param2 = "param2_example"; // String | field2 + +Object body = ; // Object | + try { - Void result = apiInstance.testJsonFormData(param, param2); + Void result = apiInstance.testJsonFormData(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testJsonFormData"); @@ -455,8 +461,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **String**| field1 | - **param2** | **String**| field2 | + **body** | [**Object**](Object.md)| | + ### Return type @@ -471,3 +477,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/retrofit2rx/docs/FakeClassnameTags123Api.md index 715fed0dc0b..2336289e187 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/retrofit2rx/docs/FakeClassnameTags123Api.md @@ -7,33 +7,28 @@ Method | HTTP request | Description [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** fake_classname_test | To test class name in snake case + + # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case ### 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.FakeClassnameTags123Api; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure API key authorization: api_key_query -ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); -api_key_query.setApiKey("YOUR API KEY"); -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model + +Client 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 +40,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -60,3 +56,5 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + + 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..bc11b93cb26 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/FormatTest.md +++ b/samples/client/petstore/java/retrofit2rx/docs/FormatTest.md @@ -11,8 +11,8 @@ Name | Type | Description | Notes **_float** | **Float** | | [optional] **_double** | **Double** | | [optional] **string** | **String** | | [optional] -**_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**_byte** | **String** | | +**binary** | **String** | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] @@ -20,3 +20,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/retrofit2rx/docs/HasOnlyReadOnly.md index c1d0aac5672..5564ddcf28a 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/java/retrofit2rx/docs/HasOnlyReadOnly.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx/docs/MapTest.md b/samples/client/petstore/java/retrofit2rx/docs/MapTest.md index 714a97a40d9..74a6fe8ae70 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/MapTest.md +++ b/samples/client/petstore/java/retrofit2rx/docs/MapTest.md @@ -8,12 +8,11 @@ Name | Type | Description | Notes **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] + ## Enum: Map<String, InnerEnum> Name | Value ---- | ----- -UPPER | "UPPER" -LOWER | "lower" diff --git a/samples/client/petstore/java/retrofit2rx/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/retrofit2rx/docs/MixedPropertiesAndAdditionalPropertiesClass.md index b12e2cd70e6..4507481b5a9 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/retrofit2rx/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx/docs/Model200Response.md b/samples/client/petstore/java/retrofit2rx/docs/Model200Response.md index 5b3a9a0e46d..8d2cc50bb83 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/Model200Response.md +++ b/samples/client/petstore/java/retrofit2rx/docs/Model200Response.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx/docs/ModelApiResponse.md b/samples/client/petstore/java/retrofit2rx/docs/ModelApiResponse.md index 3eec8686cc9..06052b202f1 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/ModelApiResponse.md +++ b/samples/client/petstore/java/retrofit2rx/docs/ModelApiResponse.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx/docs/ModelReturn.md b/samples/client/petstore/java/retrofit2rx/docs/ModelReturn.md index a679b04953e..a7845ba254b 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/ModelReturn.md +++ b/samples/client/petstore/java/retrofit2rx/docs/ModelReturn.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx/docs/Name.md b/samples/client/petstore/java/retrofit2rx/docs/Name.md index ce2fb4dee50..a8d6fec9714 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/Name.md +++ b/samples/client/petstore/java/retrofit2rx/docs/Name.md @@ -11,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx/docs/NumberOnly.md b/samples/client/petstore/java/retrofit2rx/docs/NumberOnly.md index a3feac7fadc..adfb36a95bb 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/NumberOnly.md +++ b/samples/client/petstore/java/retrofit2rx/docs/NumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx/docs/Order.md b/samples/client/petstore/java/retrofit2rx/docs/Order.md index 268c617d1ff..7e4beff6df1 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/Order.md +++ b/samples/client/petstore/java/retrofit2rx/docs/Order.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/retrofit2rx/docs/OuterComposite.md b/samples/client/petstore/java/retrofit2rx/docs/OuterComposite.md index 3f5a633c998..1963c7a0f73 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/OuterComposite.md +++ b/samples/client/petstore/java/retrofit2rx/docs/OuterComposite.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx/docs/Pet.md b/samples/client/petstore/java/retrofit2rx/docs/Pet.md index 5b63109ef92..1492195a58d 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/Pet.md +++ b/samples/client/petstore/java/retrofit2rx/docs/Pet.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/retrofit2rx/docs/PetApi.md b/samples/client/petstore/java/retrofit2rx/docs/PetApi.md index ea3c05ad412..c5748bb7cd3 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/PetApi.md @@ -14,33 +14,28 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** pet/{petId}/uploadImage | uploads an image + + # **addPet** -> Void addPet(body) +> Void addPet(pet) 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 + +Pet pet = ; // Pet | Pet object that needs to be added to the store + try { - Void result = apiInstance.addPet(body); + Void result = apiInstance.addPet(pet); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); @@ -52,7 +47,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -65,7 +61,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **deletePet** @@ -73,26 +70,20 @@ Name | Type | Description | Notes 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 | + +Integer petId = Arrays.asList(56); // Integer | Pet id to delete + +String apiKey = Arrays.asList("apiKey_example"); // String | + try { Void result = apiInstance.deletePet(petId, apiKey); System.out.println(result); @@ -106,8 +97,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | - **apiKey** | **String**| | [optional] + **petId** | [**Integer**](.md)| Pet id to delete | + **apiKey** | [**String**](.md)| | [optional] + ### Return type @@ -120,7 +112,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **findPetsByStatus** @@ -133,20 +126,15 @@ 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); @@ -160,7 +148,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: ] + ### Return type @@ -175,6 +164,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **findPetsByTags** > List<Pet> findPetsByTags(tags) @@ -186,20 +176,15 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### 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); @@ -215,6 +200,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | + ### Return type [**List<Pet>**](Pet.md) @@ -228,6 +214,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **getPetById** > Pet getPetById(petId) @@ -239,22 +226,15 @@ 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to return + try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -268,7 +248,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to return | + **petId** | [**Integer**](.md)| ID of pet to return | + ### Return type @@ -283,33 +264,27 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **updatePet** -> Void updatePet(body) +> Void updatePet(pet) 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 + +Pet pet = ; // Pet | Pet object that needs to be added to the store + try { - Void result = apiInstance.updatePet(body); + Void result = apiInstance.updatePet(pet); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); @@ -321,7 +296,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -334,37 +310,31 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updatePetWithForm** -> Void updatePetWithForm(petId, name, status) +> Void updatePetWithForm(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet that needs to be updated + +Object body = ; // Object | + try { - Void result = apiInstance.updatePetWithForm(petId, name, status); + Void result = apiInstance.updatePetWithForm(petId, body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePetWithForm"); @@ -376,9 +346,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet that needs to be updated | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -391,37 +361,31 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **uploadFile** -> ModelApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to update + +Object body = ; // Object | + try { - ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); + ModelApiResponse result = apiInstance.uploadFile(petId, body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFile"); @@ -433,9 +397,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet to update | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -450,3 +414,5 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/ReadOnlyFirst.md b/samples/client/petstore/java/retrofit2rx/docs/ReadOnlyFirst.md index 426b7cde95a..57655e5b49e 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/java/retrofit2rx/docs/ReadOnlyFirst.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx/docs/SpecialModelName.md b/samples/client/petstore/java/retrofit2rx/docs/SpecialModelName.md index c2c6117c552..f4259d2a73c 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/SpecialModelName.md +++ b/samples/client/petstore/java/retrofit2rx/docs/SpecialModelName.md @@ -4,7 +4,8 @@ ## 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 134f0c36578..35b66fd8485 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/StoreApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/StoreApi.md @@ -10,6 +10,8 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet + + # **deleteOrder** > Void deleteOrder(orderId) @@ -25,8 +27,11 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + +String orderId = Arrays.asList("orderId_example"); // String | ID of the order that needs to be deleted + try { Void result = apiInstance.deleteOrder(orderId); System.out.println(result); @@ -40,7 +45,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | + **orderId** | [**String**](.md)| ID of the order that needs to be deleted | + ### Return type @@ -53,7 +59,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getInventory** @@ -66,21 +73,13 @@ 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); @@ -93,6 +92,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type **Map<String, Integer>** @@ -106,6 +106,7 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json + # **getOrderById** > Order getOrderById(orderId) @@ -121,8 +122,11 @@ For valid response try integer IDs with value <= 5 or > 10. Other val //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched + +Integer orderId = Arrays.asList(56); // Integer | ID of pet that needs to be fetched + try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -136,7 +140,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | [**Integer**](.md)| ID of pet that needs to be fetched | + ### Return type @@ -151,14 +156,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -166,10 +170,13 @@ Place an order for a pet //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet + +Order 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"); @@ -181,7 +188,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](.md)| order placed for purchasing the pet | + ### Return type @@ -193,6 +201,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: */* - **Accept**: application/xml, application/json + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/Tag.md b/samples/client/petstore/java/retrofit2rx/docs/Tag.md index de6814b55d5..7a97d4c6812 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/Tag.md +++ b/samples/client/petstore/java/retrofit2rx/docs/Tag.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx/docs/User.md b/samples/client/petstore/java/retrofit2rx/docs/User.md index 8b6753dd284..cf7f9ce1312 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/User.md +++ b/samples/client/petstore/java/retrofit2rx/docs/User.md @@ -15,3 +15,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx/docs/UserApi.md b/samples/client/petstore/java/retrofit2rx/docs/UserApi.md index 40096ec05bc..619b98b9fa7 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/UserApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/UserApi.md @@ -14,9 +14,11 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** user/{username} | Updated user + + # **createUser** -> Void createUser(body) +> Void createUser(user) Create user @@ -29,10 +31,13 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object + +User user = ; // User | Created user object + try { - Void result = apiInstance.createUser(body); + Void result = apiInstance.createUser(user); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); @@ -44,7 +49,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](.md)| Created user object | + ### Return type @@ -56,8 +62,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithArrayInput** @@ -65,8 +72,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -74,8 +79,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { Void result = apiInstance.createUsersWithArrayInput(body); System.out.println(result); @@ -91,6 +99,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type [**Void**](.md) @@ -101,8 +110,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithListInput** @@ -110,8 +120,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -119,8 +127,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { Void result = apiInstance.createUsersWithListInput(body); System.out.println(result); @@ -136,6 +147,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type [**Void**](.md) @@ -146,8 +158,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **deleteUser** @@ -164,8 +177,11 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be deleted + +String username = Arrays.asList("username_example"); // String | The name that needs to be deleted + try { Void result = apiInstance.deleteUser(username); System.out.println(result); @@ -179,7 +195,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | + **username** | [**String**](.md)| The name that needs to be deleted | + ### Return type @@ -192,7 +209,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getUserByName** @@ -200,8 +218,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -209,8 +225,11 @@ Get user by user name //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. + +String username = Arrays.asList("username_example"); // String | The name that needs to be fetched. Use user1 for testing. + try { User result = apiInstance.getUserByName(username); System.out.println(result); @@ -224,7 +243,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + **username** | [**String**](.md)| The name that needs to be fetched. Use user1 for testing. | + ### Return type @@ -239,14 +259,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **loginUser** > String loginUser(username, password) Logs user into the system - - ### Example ```java // Import classes: @@ -254,9 +273,13 @@ Logs user into the system //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 + +String username = Arrays.asList("username_example"); // String | The user name for login + +String password = Arrays.asList("password_example"); // String | The password for login in clear text + try { String result = apiInstance.loginUser(username, password); System.out.println(result); @@ -270,8 +293,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | + **username** | [**String**](.md)| The user name for login | + **password** | [**String**](.md)| The password for login in clear text | + ### Return type @@ -286,14 +310,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **logoutUser** > Void logoutUser() Logs out current logged in user session - - ### Example ```java // Import classes: @@ -301,7 +324,9 @@ Logs out current logged in user session //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); + try { Void result = apiInstance.logoutUser(); System.out.println(result); @@ -314,6 +339,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type [**Void**](.md) @@ -325,11 +351,12 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updateUser** -> Void updateUser(username, body) +> Void updateUser(user, username) Updated user @@ -342,11 +369,15 @@ This can only be done by the logged in user. //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 + +User user = ; // User | Updated user object + +String username = Arrays.asList("username_example"); // String | name that need to be deleted + try { - Void result = apiInstance.updateUser(username, body); + Void result = apiInstance.updateUser(user, username); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); @@ -358,8 +389,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](.md)| Updated user object | + **username** | [**String**](.md)| name that need to be deleted | + ### Return type @@ -371,6 +403,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + + diff --git a/samples/client/petstore/java/retrofit2rx/git_push.sh b/samples/client/petstore/java/retrofit2rx/git_push.sh index ae01b182ae9..ed374619b13 100644 --- a/samples/client/petstore/java/retrofit2rx/git_push.sh +++ b/samples/client/petstore/java/retrofit2rx/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 credential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential 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/retrofit2rx/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/retrofit2rx/gradle/wrapper/gradle-wrapper.jar index 2c6137b8789..e69de29bb2d 100644 Binary files a/samples/client/petstore/java/retrofit2rx/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/retrofit2rx/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/retrofit2rx/pom.xml b/samples/client/petstore/java/retrofit2rx/pom.xml index 38cc4913cd2..17e11835669 100644 --- a/samples/client/petstore/java/retrofit2rx/pom.xml +++ b/samples/client/petstore/java/retrofit2rx/pom.xml @@ -1,260 +1,256 @@ - 4.0.0 - io.swagger - swagger-petstore-retrofit2-rx - jar - swagger-petstore-retrofit2-rx - 1.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-petstore-retrofit2-rx + jar + swagger-petstore-retrofit2-rx + 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 - 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 + - - - 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 - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - 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.2 - - - - jar - test-jar - - - - - - + + + + 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.codehaus.mojo - build-helper-maven-plugin - 1.10 - - - 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-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + 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-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} - - - com.squareup.retrofit2 - converter-gson - ${retrofit-version} - - - com.squareup.retrofit2 - retrofit - ${retrofit-version} - - - com.squareup.retrofit2 - converter-scalars - ${retrofit-version} - - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - ${oltu-version} - - - io.gsonfire - gson-fire - ${gson-fire-version} - - - org.threeten - threetenbp - ${threetenbp-version} - - - io.reactivex - rxjava - ${rxjava-version} - - - com.squareup.retrofit2 - adapter-rxjava - ${retrofit-version} - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + io.swagger + swagger-annotations + ${swagger-core-version} + + + com.squareup.retrofit2 + converter-gson + ${retrofit-version} + + + com.squareup.retrofit2 + retrofit + ${retrofit-version} + + + com.squareup.retrofit2 + converter-scalars + ${retrofit-version} + + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + ${oltu-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + + + org.threeten + threetenbp + ${threetenbp-version} + + + + + io.reactivex + rxjava + ${rxjava-version} + + + com.squareup.retrofit2 + adapter-rxjava + ${retrofit-version} + + + + + + - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.7 - ${java.version} - ${java.version} - 1.8.0 - 1.5.15 - 2.3.0 - 1.3.0 - 1.3.5 - 1.0.1 - 4.12 - + + + junit + junit + ${junit-version} + test + + + + UTF-8 + 1.7 + ${java.version} + ${java.version} + 1.8.0 + 1.5.15 + + 2.3.0 + + 1.3.0 + + + + + 1.3.5 + + 1.0.2 + 4.12 + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/ApiClient.java index 03c74e2ac20..349ef76aeb1 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/ApiClient.java @@ -9,10 +9,16 @@ import okhttp3.ResponseBody; import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; + + import org.threeten.bp.format.DateTimeFormatter; + import retrofit2.Converter; import retrofit2.Retrofit; + import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; + + import retrofit2.converter.gson.GsonConverterFactory; import retrofit2.converter.scalars.ScalarsConverterFactory; import io.swagger.client.auth.HttpBasicAuth; @@ -25,6 +31,7 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.text.DateFormat; + import java.util.LinkedHashMap; import java.util.Map; import java.util.HashMap; @@ -44,20 +51,39 @@ public ApiClient() { public ApiClient(String[] authNames) { this(); for(String authName : authNames) { + Interceptor auth; if ("api_key".equals(authName)) { + + auth = new ApiKeyAuth("header", "api_key"); + + } else if ("api_key_query".equals(authName)) { + + auth = new ApiKeyAuth("query", "api_key_query"); + + } else if ("http_basic_test".equals(authName)) { + auth = new HttpBasicAuth(); + + + } else if ("petstore_auth".equals(authName)) { - auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); + + + + auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", ""); + } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } addAuthorization(authName, auth); + + } } @@ -118,8 +144,10 @@ public void createDefaultAdapter() { adapterBuilder = new Retrofit .Builder() .baseUrl(baseUrl) + .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) - .addConverterFactory(ScalarsConverterFactory.create()) + + .addConverterFactory(ScalarsConverterFactory.create()) .addConverterFactory(GsonCustomConverterFactory.create(json.getGson())); } @@ -140,6 +168,8 @@ public ApiClient setSqlDateFormat(DateFormat dateFormat) { return this; } + + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { this.json.setOffsetDateTimeFormat(dateFormat); return this; @@ -150,6 +180,7 @@ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { return this; } + /** * Helper method to configure the first api key found 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..1f72d74749f 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 @@ -23,10 +23,13 @@ import com.google.gson.JsonElement; import io.gsonfire.GsonFireBuilder; import io.gsonfire.TypeSelector; + + import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import org.threeten.bp.format.DateTimeFormatter; + import io.swagger.client.model.*; import java.io.IOException; @@ -35,6 +38,7 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; + import java.util.Date; import java.util.Map; import java.util.HashMap; @@ -43,23 +47,31 @@ public class JSON { private Gson gson; private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + + private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + public static GsonBuilder createGson() { GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(Animal.class, new TypeSelector() { @Override public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Cat".toUpperCase(), Cat.class); + classByDiscriminatorValue.put("Dog".toUpperCase(), Dog.class); + classByDiscriminatorValue.put("Animal".toUpperCase(), Animal.class); return getClassByDiscriminator( classByDiscriminatorValue, - getDiscriminatorValue(readElement, "className")); + getDiscriminatorValue(readElement, "Discriminator{propertyName='className', mapping=null}")); } }) + ; return fireBuilder.createGsonBuilder(); } @@ -84,8 +96,11 @@ public JSON() { gson = createGson() .registerTypeAdapter(Date.class, dateTypeAdapter) .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) + + .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) + .create(); } @@ -109,6 +124,8 @@ public JSON setGson(Gson gson) { return this; } + + /** * Gson TypeAdapter for JSR310 OffsetDateTime type */ @@ -204,6 +221,7 @@ public JSON setLocalDateFormat(DateTimeFormatter dateFormat) { return this; } + /** * Gson TypeAdapter for java.sql.Date type * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used 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 3d71a91b2ab..c74c6ee9b22 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 @@ -2,7 +2,11 @@ import io.swagger.client.CollectionFormats.*; + import rx.Observable; + + + import retrofit2.http.*; import okhttp3.RequestBody; @@ -10,24 +14,41 @@ import io.swagger.client.model.Client; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + 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({ "Content-Type:application/json" }) + + + @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 475de10d940..400ba378b33 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 @@ -2,7 +2,11 @@ import io.swagger.client.CollectionFormats.*; + import rx.Observable; + + + import retrofit2.http.*; import okhttp3.RequestBody; @@ -10,143 +14,255 @@ 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 java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public interface FakeApi { + /** * * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Call<Boolean> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("fake/outer/boolean") Observable fakeOuterBooleanSerialize( @retrofit2.http.Body Boolean body ); + /** * * 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> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("fake/outer/composite") Observable fakeOuterCompositeSerialize( - @retrofit2.http.Body OuterComposite body + @retrofit2.http.Body OuterComposite outercomposite ); + /** * * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return Call<BigDecimal> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("fake/outer/number") Observable fakeOuterNumberSerialize( @retrofit2.http.Body BigDecimal body ); + /** * * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return Call<String> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("fake/outer/string") Observable fakeOuterStringSerialize( @retrofit2.http.Body String body ); + /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + + * @param client client model (required) + * @return Call<Client> + */ + + + + @Headers({ "Content-Type:application/json" }) + + + @PATCH("fake") Observable testClientModel( - @retrofit2.http.Body Client body + @retrofit2.http.Body Client client ); + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) + + * @param body (required) + * @return Call<Void> + */ - @retrofit2.http.FormUrlEncoded + + + + + @Headers({ + "Content-Type:application/json; charset=utf-8" + }) + + + + + @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.Body Object body ); + /** * 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 body (optional) + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + + * @param enumHeaderString Header parameter enum test (string) (optional) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + + * @param enumQueryString Query parameter enum test (string) (optional) + * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) + * @return Call<Void> + */ - @retrofit2.http.FormUrlEncoded + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @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.Body Object body, @retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Path("enum_query_string_array") List enumQueryStringArray, @retrofit2.http.Path("enum_query_string") String enumQueryString, @retrofit2.http.Path("enum_query_integer") Integer enumQueryInteger ); + /** * test inline additionalProperties * - * @param param request body (required) + + * @param body request body (required) + * @return Call<Void> + */ + + + + @Headers({ "Content-Type:application/json" }) + + + @POST("fake/inline-additionalProperties") Observable testInlineAdditionalProperties( - @retrofit2.http.Body Object param + @retrofit2.http.Body Map body ); + /** * test json serialization of form data * - * @param param field1 (required) - * @param param2 field2 (required) + + * @param body (required) + * @return Call<Void> + */ - @retrofit2.http.FormUrlEncoded + + + + + @Headers({ + "Content-Type:application/json" + }) + + + @GET("fake/jsonFormData") Observable testJsonFormData( - @retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2 + @retrofit2.http.Body Object body ); + } + 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 092f0bf5c50..1b79d5effbb 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 @@ -2,7 +2,11 @@ import io.swagger.client.CollectionFormats.*; + import rx.Observable; + + + import retrofit2.http.*; import okhttp3.RequestBody; @@ -10,24 +14,41 @@ import io.swagger.client.model.Client; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public interface FakeClassnameTags123Api { + /** * To test class name in snake case * - * @param body client model (required) + + * @param client client model (required) + * @return Call<Client> + */ + + + + @Headers({ "Content-Type:application/json" }) + + + @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 4f848e7d69f..e13998a8ccb 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 @@ -2,121 +2,209 @@ import io.swagger.client.CollectionFormats.*; + import rx.Observable; + + + import retrofit2.http.*; import okhttp3.RequestBody; import okhttp3.ResponseBody; -import java.io.File; import io.swagger.client.model.ModelApiResponse; import io.swagger.client.model.Pet; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + 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({ "Content-Type:application/json" }) + + + + + @POST("pet") Observable addPet( - @retrofit2.http.Body Pet body + @retrofit2.http.Body Pet pet ); + /** * Deletes a pet * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Call<Void> + */ + + + + @DELETE("pet/{petId}") Observable deletePet( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Header("api_key") String apiKey + @retrofit2.http.Path("petId") Integer petId, @retrofit2.http.Header("api_key") String apiKey ); + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @return Call<List<Pet>> + */ + + + + @GET("pet/findByStatus") Observable> findPetsByStatus( - @retrofit2.http.Query("status") CSVParams status + @retrofit2.http.Path("status") List status ); + /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @return Call<List<Pet>> + */ + + + + @GET("pet/findByTags") Observable> findPetsByTags( - @retrofit2.http.Query("tags") CSVParams tags + @retrofit2.http.Path("tags") List tags ); + /** * Find pet by ID * Returns a single pet + * @param petId ID of pet to return (required) + * @return Call<Pet> + */ + + + + @GET("pet/{petId}") Observable getPetById( - @retrofit2.http.Path("petId") Long petId + @retrofit2.http.Path("petId") Integer petId ); + /** * 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({ "Content-Type:application/json" }) + + + + + @PUT("pet") Observable updatePet( - @retrofit2.http.Body Pet body + @retrofit2.http.Body Pet pet ); + /** * Updates a pet in the store with form data * + * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) + + * @param body (optional) + * @return Call<Void> + */ - @retrofit2.http.FormUrlEncoded + + + + + @Headers({ + "Content-Type:application/x-www-form-urlencoded" + }) + + + @POST("pet/{petId}") Observable updatePetWithForm( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Field("name") String name, @retrofit2.http.Field("status") String status + @retrofit2.http.Path("petId") Integer petId, @retrofit2.http.Body Object body ); + /** * uploads an image * + * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) + + * @param body (optional) + * @return Call<ModelApiResponse> + */ - @retrofit2.http.Multipart + + + + @POST("pet/{petId}/uploadImage") Observable uploadFile( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part("file\"; filename=\"file") RequestBody file + @retrofit2.http.Path("petId") Integer petId, @retrofit2.http.Body Object body ); + } + 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 b8cbf56d1b3..3572569d0b0 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 @@ -2,7 +2,11 @@ import io.swagger.client.CollectionFormats.*; + import rx.Observable; + + + import retrofit2.http.*; import okhttp3.RequestBody; @@ -10,52 +14,95 @@ import io.swagger.client.model.Order; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public interface StoreApi { + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @return Call<Void> + */ + + + + @DELETE("store/order/{order_id}") Observable deleteOrder( @retrofit2.http.Path("order_id") String orderId ); + /** * Returns pet inventories by status * Returns a map of status codes to quantities + * @return Call<Map<String, Integer>> + */ + + + + @GET("store/inventory") Observable> getInventory(); + /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @return Call<Order> + */ + + + + @GET("store/order/{order_id}") Observable getOrderById( - @retrofit2.http.Path("order_id") Long orderId + @retrofit2.http.Path("order_id") Integer orderId ); + /** * 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> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @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 f0bff0c7730..84fcf77593b 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 @@ -2,7 +2,11 @@ import io.swagger.client.CollectionFormats.*; + import rx.Observable; + + + import retrofit2.http.*; import okhttp3.RequestBody; @@ -10,98 +14,193 @@ import io.swagger.client.model.User; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + 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> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @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) + * @return Call<Void> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("user/createWithArray") Observable createUsersWithArrayInput( @retrofit2.http.Body List body ); + /** * Creates list of users with given input array * + * @param body List of user object (required) + * @return Call<Void> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("user/createWithList") Observable createUsersWithListInput( @retrofit2.http.Body List body ); + /** * Delete user * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @return Call<Void> + */ + + + + @DELETE("user/{username}") Observable deleteUser( @retrofit2.http.Path("username") String username ); + /** * Get user by user name * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return Call<User> + */ + + + + @GET("user/{username}") Observable getUserByName( @retrofit2.http.Path("username") String username ); + /** * Logs user into the system * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return Call<String> + */ + + + + @GET("user/login") Observable loginUser( - @retrofit2.http.Query("username") String username, @retrofit2.http.Query("password") String password + @retrofit2.http.Path("username") String username, @retrofit2.http.Path("password") String password ); + /** * Logs out current logged in user session * + * @return Call<Void> + */ + + + + @GET("user/logout") Observable logoutUser(); + /** * Updated user * This can only be done by the logged in user. + + * @param user Updated user object (required) + * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @return Call<Void> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @PUT("user/{username}") Observable updateUser( - @retrofit2.http.Path("username") String username, @retrofit2.http.Body User body + @retrofit2.http.Body User user, @retrofit2.http.Path("username") String username ); + } + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/auth/OAuthOkHttpClient.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/auth/OAuthOkHttpClient.java index c9b6e124d51..ab5acf4cc53 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/auth/OAuthOkHttpClient.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/auth/OAuthOkHttpClient.java @@ -59,6 +59,7 @@ public T execute(OAuthClientRequest request, Map response.body().string(), response.body().contentType().toString(), response.code(), + response.headers().toMultimap(), responseClass); } catch (IOException e) { throw new OAuthSystemException(e); diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index b302fdf6012..56510d9ad3c 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -31,65 +31,63 @@ */ public class AdditionalPropertiesClass { - @SerializedName("map_property") +@SerializedName("map_property") private Map mapProperty = null; - @SerializedName("map_of_map_property") private Map> mapOfMapProperty = null; - + public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; return this; } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { this.mapProperty = new HashMap(); } + this.mapProperty.put(key, mapPropertyItem); return this; } - - /** - * Get mapProperty - * @return mapProperty + /** + * Get mapProperty + * @return mapProperty **/ @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } - public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } - + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; return this; } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { this.mapOfMapProperty = new HashMap>(); } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } - - /** - * Get mapOfMapProperty - * @return mapOfMapProperty + /** + * Get mapOfMapProperty + * @return mapOfMapProperty **/ @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -107,8 +105,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapProperty, mapOfMapProperty); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -131,5 +128,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Animal.java index f65c5bffcb3..7d0184c4016 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Animal.java @@ -29,49 +29,47 @@ public class Animal { - @SerializedName("className") +@SerializedName("className") private String className = null; - @SerializedName("color") private String color = "red"; - + public Animal className(String className) { this.className = className; return this; } - /** - * Get className - * @return className + + /** + * Get className + * @return className **/ @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } - public void setClassName(String className) { this.className = className; } - + public Animal color(String color) { this.color = color; return this; } - /** - * Get color - * @return color + + /** + * Get color + * @return color **/ @ApiModelProperty(value = "") public String getColor() { return color; } - public void setColor(String color) { this.color = color; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -89,8 +87,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(className, color); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -113,5 +110,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AnimalFarm.java deleted file mode 100644 index 0b1d6a74cc6..00000000000 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/AnimalFarm.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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 io.swagger.client.model.Animal; -import java.util.ArrayList; -import java.util.List; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index f9956fe46d8..6072a884b8b 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -31,36 +31,36 @@ */ public class ArrayOfArrayOfNumberOnly { - @SerializedName("ArrayArrayNumber") +@SerializedName("ArrayArrayNumber") private List> arrayArrayNumber = null; - + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; return this; } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { this.arrayArrayNumber = new ArrayList>(); } + this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber **/ @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } - public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -77,8 +77,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayArrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,5 +99,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index c79610d1c66..9d03a82a520 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -31,36 +31,36 @@ */ public class ArrayOfNumberOnly { - @SerializedName("ArrayNumber") +@SerializedName("ArrayNumber") private List arrayNumber = null; - + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; return this; } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { this.arrayNumber = new ArrayList(); } + this.arrayNumber.add(arrayNumberItem); return this; } - - /** - * Get arrayNumber - * @return arrayNumber + + /** + * Get arrayNumber + * @return arrayNumber **/ @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } - public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -77,8 +77,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,5 +99,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java index 747182e792e..16a6ebcc6f0 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ArrayTest.java @@ -31,94 +31,94 @@ */ public class ArrayTest { - @SerializedName("array_of_string") +@SerializedName("array_of_string") private List arrayOfString = null; - @SerializedName("array_array_of_integer") private List> arrayArrayOfInteger = null; - @SerializedName("array_array_of_model") private List> arrayArrayOfModel = null; - + public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; return this; } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { this.arrayOfString = new ArrayList(); } + this.arrayOfString.add(arrayOfStringItem); return this; } - - /** - * Get arrayOfString - * @return arrayOfString + + /** + * Get arrayOfString + * @return arrayOfString **/ @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } - public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } - + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { this.arrayArrayOfInteger = new ArrayList>(); } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger **/ @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } - + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { this.arrayArrayOfModel = new ArrayList>(); } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel **/ @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } - public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -137,8 +137,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -162,5 +161,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Capitalization.java index 00c564ab727..2c7727d7261 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Capitalization.java @@ -28,133 +28,127 @@ */ public class Capitalization { - @SerializedName("smallCamel") +@SerializedName("smallCamel") private String smallCamel = null; - @SerializedName("CapitalCamel") private String capitalCamel = null; - @SerializedName("small_Snake") private String smallSnake = null; - @SerializedName("Capital_Snake") private String capitalSnake = null; - @SerializedName("SCA_ETH_Flow_Points") private String scAETHFlowPoints = null; - @SerializedName("ATT_NAME") private String ATT_NAME = null; - + public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; return this; } - /** - * Get smallCamel - * @return smallCamel + + /** + * Get smallCamel + * @return smallCamel **/ @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } - public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } - + public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; return this; } - /** - * Get capitalCamel - * @return capitalCamel + + /** + * Get capitalCamel + * @return capitalCamel **/ @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } - public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } - + public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; return this; } - /** - * Get smallSnake - * @return smallSnake + + /** + * Get smallSnake + * @return smallSnake **/ @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } - public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } - + public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; return this; } - /** - * Get capitalSnake - * @return capitalSnake + + /** + * Get capitalSnake + * @return capitalSnake **/ @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } - public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } - + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; return this; } - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints **/ @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } - public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } - + public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; return this; } - /** - * Name of the pet - * @return ATT_NAME + + /** + * Name of the pet + * @return ATT_NAME **/ @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } - public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -176,8 +170,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -204,5 +197,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java index 64d3fbdc7fe..b093e138ba6 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Cat.java @@ -29,28 +29,67 @@ */ public class Cat extends Animal { +@SerializedName("className") + private String className = null; + @SerializedName("color") + private String color = "red"; @SerializedName("declawed") private Boolean declawed = null; + + public Cat className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Cat color(String color) { + this.color = color; + return this; + } + + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; } - /** - * Get declawed - * @return declawed + + /** + * Get declawed + * @return declawed **/ @ApiModelProperty(value = "") public Boolean isDeclawed() { return declawed; } - public void setDeclawed(Boolean declawed) { this.declawed = declawed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -60,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && + return Objects.equals(this.className, cat.className) && + Objects.equals(this.color, cat.color) && + Objects.equals(this.declawed, cat.declawed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(declawed, super.hashCode()); + return Objects.hash(className, color, declawed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); sb.append("}"); return sb.toString(); @@ -91,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Category.java index 4e9f8f56e5e..42e198faaff 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Category.java @@ -28,49 +28,47 @@ */ public class Category { - @SerializedName("id") +@SerializedName("id") private Long id = null; - @SerializedName("name") private String name = null; - + public Category id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Category name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -88,8 +86,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -112,5 +109,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ClassModel.java index 4cf0a053250..627c102a69a 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ClassModel.java @@ -25,32 +25,30 @@ /** * Model for testing model with \"_class\" property - */ -@ApiModel(description = "Model for testing model with \"_class\" property") + */@ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @SerializedName("_class") +@SerializedName("_class") private String propertyClass = null; - + public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,8 +65,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -90,5 +87,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Client.java index 43b20dce8da..460c9e52ba1 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Client.java @@ -28,28 +28,27 @@ */ public class Client { - @SerializedName("client") +@SerializedName("client") private String client = null; - + public Client client(String client) { this.client = client; return this; } - /** - * Get client - * @return client + + /** + * Get client + * @return client **/ @ApiModelProperty(value = "") public String getClient() { return client; } - public void setClient(String client) { this.client = client; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -66,8 +65,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(client); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,5 +87,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Dog.java index 8fad06d9835..4d52b28512f 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Dog.java @@ -29,28 +29,67 @@ */ public class Dog extends Animal { +@SerializedName("className") + private String className = null; + @SerializedName("color") + private String color = "red"; @SerializedName("breed") private String breed = null; + + public Dog className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Dog color(String color) { + this.color = color; + return this; + } + + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Dog breed(String breed) { this.breed = breed; return this; } - /** - * Get breed - * @return breed + + /** + * Get breed + * @return breed **/ @ApiModelProperty(value = "") public String getBreed() { return breed; } - public void setBreed(String breed) { this.breed = breed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -60,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && + return Objects.equals(this.className, dog.className) && + Objects.equals(this.color, dog.color) && + Objects.equals(this.breed, dog.breed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(breed, super.hashCode()); + return Objects.hash(className, color, breed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); sb.append("}"); return sb.toString(); @@ -91,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumArrays.java index 5f063c2ec38..43000487324 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumArrays.java @@ -30,13 +30,14 @@ */ public class EnumArrays { - /** + + /** * Gets or Sets justSymbol */ @JsonAdapter(JustSymbolEnum.Adapter.class) public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), + GREATER_THAN_OR_EQUAL_TO(">="), DOLLAR("$"); private String value; @@ -44,7 +45,7 @@ public enum JustSymbolEnum { JustSymbolEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -53,7 +54,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static JustSymbolEnum fromValue(String text) { for (JustSymbolEnum b : JustSymbolEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -62,7 +63,7 @@ public static JustSymbolEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final JustSymbolEnum enumeration) throws IOException { @@ -76,17 +77,18 @@ public JustSymbolEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("just_symbol") private JustSymbolEnum justSymbol = null; - - /** + + + /** * Gets or Sets arrayEnum */ @JsonAdapter(ArrayEnumEnum.Adapter.class) public enum ArrayEnumEnum { - FISH("fish"), + FISH("fish"), CRAB("crab"); private String value; @@ -94,7 +96,7 @@ public enum ArrayEnumEnum { ArrayEnumEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -103,7 +105,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static ArrayEnumEnum fromValue(String text) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -112,7 +114,7 @@ public static ArrayEnumEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final ArrayEnumEnum enumeration) throws IOException { @@ -126,55 +128,54 @@ public ArrayEnumEnum read(final JsonReader jsonReader) throws IOException { } } } - @SerializedName("array_enum") private List arrayEnum = null; - + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; return this; } - /** - * Get justSymbol - * @return justSymbol + + /** + * Get justSymbol + * @return justSymbol **/ @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } - public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } - + public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; return this; } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { this.arrayEnum = new ArrayList(); } + this.arrayEnum.add(arrayEnumItem); return this; } - - /** - * Get arrayEnum - * @return arrayEnum + + /** + * Get arrayEnum + * @return arrayEnum **/ @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } - public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -192,8 +193,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -216,5 +216,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumClass.java index 3c19333c1ce..80a5d20a545 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumClass.java @@ -16,16 +16,21 @@ import java.util.Objects; import com.google.gson.annotations.SerializedName; + + import java.io.IOException; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; + /** * Gets or Sets EnumClass */ + @JsonAdapter(EnumClass.Adapter.class) + public enum EnumClass { _ABC("_abc"), @@ -40,6 +45,7 @@ public enum EnumClass { this.value = value; } + public String getValue() { return value; } @@ -49,6 +55,7 @@ public String toString() { return String.valueOf(value); } + public static EnumClass fromValue(String text) { for (EnumClass b : EnumClass.values()) { if (String.valueOf(b.value).equals(text)) { @@ -58,6 +65,7 @@ public static EnumClass fromValue(String text) { return null; } + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final EnumClass enumeration) throws IOException { @@ -70,5 +78,8 @@ public EnumClass read(final JsonReader jsonReader) throws IOException { return EnumClass.fromValue(String.valueOf(value)); } } + } + + 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 fb20599a85c..4ca2772ab1b 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 @@ -29,15 +29,15 @@ */ public class EnumTest { - /** + + /** * Gets or Sets enumString */ @JsonAdapter(EnumStringEnum.Adapter.class) public enum EnumStringEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"), - EMPTY(""); private String value; @@ -45,7 +45,7 @@ public enum EnumStringEnum { EnumStringEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -54,7 +54,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static EnumStringEnum fromValue(String text) { for (EnumStringEnum b : EnumStringEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -63,7 +63,7 @@ public static EnumStringEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final EnumStringEnum enumeration) throws IOException { @@ -77,17 +77,17 @@ public EnumStringEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("enum_string") private EnumStringEnum enumString = null; - - /** + + /** * Gets or Sets enumInteger */ @JsonAdapter(EnumIntegerEnum.Adapter.class) public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(1), NUMBER_MINUS_1(-1); private Integer value; @@ -95,7 +95,7 @@ public enum EnumIntegerEnum { EnumIntegerEnum(Integer value) { this.value = value; } - + public Integer getValue() { return value; } @@ -104,7 +104,7 @@ public Integer getValue() { public String toString() { return String.valueOf(value); } - + public static EnumIntegerEnum fromValue(String text) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -113,7 +113,7 @@ public static EnumIntegerEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final EnumIntegerEnum enumeration) throws IOException { @@ -127,17 +127,17 @@ public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("enum_integer") private EnumIntegerEnum enumInteger = null; - - /** + + /** * Gets or Sets enumNumber */ @JsonAdapter(EnumNumberEnum.Adapter.class) public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(1.1), NUMBER_MINUS_1_DOT_2(-1.2); private Double value; @@ -145,7 +145,7 @@ public enum EnumNumberEnum { EnumNumberEnum(Double value) { this.value = value; } - + public Double getValue() { return value; } @@ -154,7 +154,7 @@ public Double getValue() { public String toString() { return String.valueOf(value); } - + public static EnumNumberEnum fromValue(String text) { for (EnumNumberEnum b : EnumNumberEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -163,7 +163,7 @@ public static EnumNumberEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final EnumNumberEnum enumeration) throws IOException { @@ -177,86 +177,84 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("enum_number") private EnumNumberEnum enumNumber = null; - @SerializedName("outerEnum") private OuterEnum outerEnum = null; - + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; } - /** - * Get enumString - * @return enumString + + /** + * Get enumString + * @return enumString **/ @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } - public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } - + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; } - /** - * Get enumInteger - * @return enumInteger + + /** + * Get enumInteger + * @return enumInteger **/ @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } - public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } - + public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; return this; } - /** - * Get enumNumber - * @return enumNumber + + /** + * Get enumNumber + * @return enumNumber **/ @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } - public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - + public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; return this; } - /** - * Get outerEnum - * @return outerEnum + + /** + * Get outerEnum + * @return outerEnum **/ @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -276,8 +274,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -302,5 +299,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\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 ddb80771fda..9979fcd8cc3 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 @@ -32,290 +32,271 @@ */ public class FormatTest { - @SerializedName("integer") +@SerializedName("integer") private Integer integer = null; - @SerializedName("int32") private Integer int32 = null; - @SerializedName("int64") private Long int64 = null; - @SerializedName("number") private BigDecimal number = null; - @SerializedName("float") private Float _float = null; - @SerializedName("double") private Double _double = null; - @SerializedName("string") private String string = null; - @SerializedName("byte") - private byte[] _byte = null; - + private String _byte = null; @SerializedName("binary") - private byte[] binary = null; - + private String binary = null; @SerializedName("date") private LocalDate date = null; - @SerializedName("dateTime") private OffsetDateTime dateTime = null; - @SerializedName("uuid") private UUID uuid = null; - @SerializedName("password") private String password = null; - + public FormatTest integer(Integer integer) { this.integer = integer; return this; } - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer **/ @ApiModelProperty(value = "") public Integer getInteger() { return integer; } - public void setInteger(Integer integer) { this.integer = integer; } - + public FormatTest int32(Integer int32) { this.int32 = int32; return this; } - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 **/ @ApiModelProperty(value = "") public Integer getInt32() { return int32; } - public void setInt32(Integer int32) { this.int32 = int32; } - + public FormatTest int64(Long int64) { this.int64 = int64; return this; } - /** - * Get int64 - * @return int64 + + /** + * Get int64 + * @return int64 **/ @ApiModelProperty(value = "") public Long getInt64() { return int64; } - public void setInt64(Long int64) { this.int64 = int64; } - + public FormatTest number(BigDecimal number) { this.number = number; return this; } - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number + + /** + * Get number + * @return number **/ @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } - public void setNumber(BigDecimal number) { this.number = number; } - + public FormatTest _float(Float _float) { this._float = _float; return this; } - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float + + /** + * Get _float + * @return _float **/ @ApiModelProperty(value = "") public Float getFloat() { return _float; } - public void setFloat(Float _float) { this._float = _float; } - + public FormatTest _double(Double _double) { this._double = _double; return this; } - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double + + /** + * Get _double + * @return _double **/ @ApiModelProperty(value = "") public Double getDouble() { return _double; } - public void setDouble(Double _double) { this._double = _double; } - + public FormatTest string(String string) { this.string = string; return this; } - /** - * Get string - * @return string + + /** + * Get string + * @return string **/ @ApiModelProperty(value = "") public String getString() { return string; } - public void setString(String string) { this.string = string; } - - public FormatTest _byte(byte[] _byte) { + + public FormatTest _byte(String _byte) { this._byte = _byte; return this; } - /** - * Get _byte - * @return _byte + + /** + * Get _byte + * @return _byte **/ @ApiModelProperty(required = true, value = "") - public byte[] getByte() { + public String getByte() { return _byte; } - - public void setByte(byte[] _byte) { + public void setByte(String _byte) { this._byte = _byte; } - - public FormatTest binary(byte[] binary) { + + public FormatTest binary(String binary) { this.binary = binary; return this; } - /** - * Get binary - * @return binary + + /** + * Get binary + * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public String getBinary() { return binary; } - - public void setBinary(byte[] binary) { + public void setBinary(String binary) { this.binary = binary; } - + public FormatTest date(LocalDate date) { this.date = date; return this; } - /** - * Get date - * @return date + + /** + * Get date + * @return date **/ @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } - public void setDate(LocalDate date) { this.date = date; } - + public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public FormatTest password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -344,8 +325,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -379,5 +359,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 1b7ff181941..ddb6837fecb 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -28,31 +28,31 @@ */ public class HasOnlyReadOnly { - @SerializedName("bar") +@SerializedName("bar") private String bar = null; - @SerializedName("foo") private String foo = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - - /** - * Get foo - * @return foo + + + /** + * Get foo + * @return foo **/ @ApiModelProperty(value = "") public String getFoo() { return foo; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,8 +70,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, foo); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -94,5 +93,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java index a791e68d8fb..29e18228896 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MapTest.java @@ -31,16 +31,17 @@ */ public class MapTest { - @SerializedName("map_map_of_string") +@SerializedName("map_map_of_string") private Map> mapMapOfString = null; - - /** + + + /** * Gets or Sets inner */ @JsonAdapter(InnerEnum.Adapter.class) public enum InnerEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"); private String value; @@ -48,7 +49,7 @@ public enum InnerEnum { InnerEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -57,7 +58,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static InnerEnum fromValue(String text) { for (InnerEnum b : InnerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -66,7 +67,7 @@ public static InnerEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final InnerEnum enumeration) throws IOException { @@ -80,63 +81,61 @@ public InnerEnum read(final JsonReader jsonReader) throws IOException { } } } - @SerializedName("map_of_enum_string") private Map mapOfEnumString = null; - + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { this.mapMapOfString = new HashMap>(); } + this.mapMapOfString.put(key, mapMapOfStringItem); return this; } - - /** - * Get mapMapOfString - * @return mapMapOfString + /** + * Get mapMapOfString + * @return mapMapOfString **/ @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } - public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } - + public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; return this; } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { this.mapOfEnumString = new HashMap(); } + this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } - - /** - * Get mapOfEnumString - * @return mapOfEnumString + /** + * Get mapOfEnumString + * @return mapOfEnumString **/ @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } - public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,8 +153,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -178,5 +176,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 7c99abe53eb..9efda42416f 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -34,78 +34,75 @@ */ public class MixedPropertiesAndAdditionalPropertiesClass { - @SerializedName("uuid") +@SerializedName("uuid") private UUID uuid = null; - @SerializedName("dateTime") private OffsetDateTime dateTime = null; - @SerializedName("map") private Map map = null; - + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; return this; } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { this.map = new HashMap(); } + this.map.put(key, mapItem); return this; } - - /** - * Get map - * @return map + /** + * Get map + * @return map **/ @ApiModelProperty(value = "") public Map getMap() { return map; } - public void setMap(Map map) { this.map = map; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -124,8 +121,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(uuid, dateTime, map); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -149,5 +145,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 0d39eb7eff5..66416f6c0cb 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 @@ -25,53 +25,50 @@ /** * Model for testing model name starting with number - */ -@ApiModel(description = "Model for testing model name starting with number") + */@ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @SerializedName("name") +@SerializedName("name") private Integer name = null; - @SerializedName("class") private String propertyClass = null; - + public Model200Response name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - + public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -89,8 +86,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -113,5 +109,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelApiResponse.java index 3d9352c50aa..5217ac1d2ea 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -28,70 +28,67 @@ */ public class ModelApiResponse { - @SerializedName("code") +@SerializedName("code") private Integer code = null; - @SerializedName("type") private String type = null; - @SerializedName("message") private String message = null; - + public ModelApiResponse code(Integer code) { this.code = code; return this; } - /** - * Get code - * @return code + + /** + * Get code + * @return code **/ @ApiModelProperty(value = "") public Integer getCode() { return code; } - public void setCode(Integer code) { this.code = code; } - + public ModelApiResponse type(String type) { this.type = type; return this; } - /** - * Get type - * @return type + + /** + * Get type + * @return type **/ @ApiModelProperty(value = "") public String getType() { return type; } - public void setType(String type) { this.type = type; } - + public ModelApiResponse message(String message) { this.message = message; return this; } - /** - * Get message - * @return message + + /** + * Get message + * @return message **/ @ApiModelProperty(value = "") public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,8 +107,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(code, type, message); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -135,5 +131,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelReturn.java index ab6333ff86d..21d717b8076 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelReturn.java @@ -25,32 +25,30 @@ /** * Model for testing reserved words - */ -@ApiModel(description = "Model for testing reserved words") + */@ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @SerializedName("return") +@SerializedName("return") private Integer _return = null; - + public ModelReturn _return(Integer _return) { this._return = _return; return this; } - /** - * Get _return - * @return _return + + /** + * Get _return + * @return _return **/ @ApiModelProperty(value = "") public Integer getReturn() { return _return; } - public void setReturn(Integer _return) { this._return = _return; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,8 +65,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(_return); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -90,5 +87,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 1492add2952..c631e933a60 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 @@ -25,77 +25,74 @@ /** * Model for testing model name same as property name - */ -@ApiModel(description = "Model for testing model name same as property name") + */@ApiModel(description = "Model for testing model name same as property name") public class Name { - @SerializedName("name") +@SerializedName("name") private Integer name = null; - @SerializedName("snake_case") private Integer snakeCase = null; - @SerializedName("property") private String property = null; - @SerializedName("123Number") private Integer _123Number = null; - + public Name name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - - /** - * Get snakeCase - * @return snakeCase + + + /** + * Get snakeCase + * @return snakeCase **/ @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } - + public Name property(String property) { this.property = property; return this; } - /** - * Get property - * @return property + + /** + * Get property + * @return property **/ @ApiModelProperty(value = "") public String getProperty() { return property; } - public void setProperty(String property) { this.property = property; } - - /** - * Get _123Number - * @return _123Number + + + /** + * Get _123Number + * @return _123Number **/ @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -115,8 +112,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, snakeCase, property, _123Number); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -141,5 +137,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/NumberOnly.java index b13c0536a13..0468fa26f78 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/NumberOnly.java @@ -29,28 +29,27 @@ */ public class NumberOnly { - @SerializedName("JustNumber") +@SerializedName("JustNumber") private BigDecimal justNumber = null; - + public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; return this; } - /** - * Get justNumber - * @return justNumber + + /** + * Get justNumber + * @return justNumber **/ @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } - public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,8 +66,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -90,5 +88,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java index 4dcf75a7cd0..6192a446f0a 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Order.java @@ -29,27 +29,23 @@ */ public class Order { - @SerializedName("id") +@SerializedName("id") private Long id = null; - @SerializedName("petId") private Long petId = null; - @SerializedName("quantity") private Integer quantity = null; - @SerializedName("shipDate") private OffsetDateTime shipDate = null; - - /** + + /** * Order Status */ @JsonAdapter(StatusEnum.Adapter.class) public enum StatusEnum { - PLACED("placed"), + PLACED("placed"), APPROVED("approved"), - DELIVERED("delivered"); private String value; @@ -57,7 +53,7 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -66,7 +62,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -75,7 +71,7 @@ public static StatusEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { @@ -89,122 +85,120 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("status") private StatusEnum status = null; - @SerializedName("complete") private Boolean complete = false; - + public Order id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Order petId(Long petId) { this.petId = petId; return this; } - /** - * Get petId - * @return petId + + /** + * Get petId + * @return petId **/ @ApiModelProperty(value = "") public Long getPetId() { return petId; } - public void setPetId(Long petId) { this.petId = petId; } - + public Order quantity(Integer quantity) { this.quantity = quantity; return this; } - /** - * Get quantity - * @return quantity + + /** + * Get quantity + * @return quantity **/ @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } - public void setQuantity(Integer quantity) { this.quantity = quantity; } - + public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; return this; } - /** - * Get shipDate - * @return shipDate + + /** + * Get shipDate + * @return shipDate **/ @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } - public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } - + public Order status(StatusEnum status) { this.status = status; return this; } - /** - * Order Status - * @return status + + /** + * Order Status + * @return status **/ @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - + public Order complete(Boolean complete) { this.complete = complete; return this; } - /** - * Get complete - * @return complete + + /** + * Get complete + * @return complete **/ @ApiModelProperty(value = "") public Boolean isComplete() { return complete; } - public void setComplete(Boolean complete) { this.complete = complete; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -226,8 +220,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -254,5 +247,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterComposite.java index 56159fe5d93..039a870d41b 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterComposite.java @@ -29,70 +29,67 @@ */ public class OuterComposite { - @SerializedName("my_number") +@SerializedName("my_number") private BigDecimal myNumber = null; - @SerializedName("my_string") private String myString = null; - @SerializedName("my_boolean") private Boolean myBoolean = null; - + public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; return this; } - /** - * Get myNumber - * @return myNumber + + /** + * Get myNumber + * @return myNumber **/ @ApiModelProperty(value = "") public BigDecimal getMyNumber() { return myNumber; } - public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } - + public OuterComposite myString(String myString) { this.myString = myString; return this; } - /** - * Get myString - * @return myString + + /** + * Get myString + * @return myString **/ @ApiModelProperty(value = "") public String getMyString() { return myString; } - public void setMyString(String myString) { this.myString = myString; } - + public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; return this; } - /** - * Get myBoolean - * @return myBoolean + + /** + * Get myBoolean + * @return myBoolean **/ @ApiModelProperty(value = "") public Boolean getMyBoolean() { return myBoolean; } - public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -111,8 +108,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(myNumber, myString, myBoolean); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -136,5 +132,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterEnum.java index 3b24acc6b51..2bb0d8fcb27 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/OuterEnum.java @@ -16,16 +16,21 @@ import java.util.Objects; import com.google.gson.annotations.SerializedName; + + import java.io.IOException; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; + /** * Gets or Sets OuterEnum */ + @JsonAdapter(OuterEnum.Adapter.class) + public enum OuterEnum { PLACED("placed"), @@ -40,6 +45,7 @@ public enum OuterEnum { this.value = value; } + public String getValue() { return value; } @@ -49,6 +55,7 @@ public String toString() { return String.valueOf(value); } + public static OuterEnum fromValue(String text) { for (OuterEnum b : OuterEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -58,6 +65,7 @@ public static OuterEnum fromValue(String text) { return null; } + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final OuterEnum enumeration) throws IOException { @@ -70,5 +78,8 @@ public OuterEnum read(final JsonReader jsonReader) throws IOException { return OuterEnum.fromValue(String.valueOf(value)); } } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java index dac1250ac07..2b91dae9614 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Pet.java @@ -32,30 +32,25 @@ */ public class Pet { - @SerializedName("id") +@SerializedName("id") private Long id = null; - @SerializedName("category") private Category category = null; - @SerializedName("name") private String name = null; - @SerializedName("photoUrls") private List photoUrls = new ArrayList(); - @SerializedName("tags") private List tags = null; - - /** + + /** * pet status in the store */ @JsonAdapter(StatusEnum.Adapter.class) public enum StatusEnum { - AVAILABLE("available"), + AVAILABLE("available"), PENDING("pending"), - SOLD("sold"); private String value; @@ -63,7 +58,7 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -72,7 +67,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -81,7 +76,7 @@ public static StatusEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { @@ -95,132 +90,132 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("status") private StatusEnum status = null; - + public Pet id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Pet category(Category category) { this.category = category; return this; } - /** - * Get category - * @return category + + /** + * Get category + * @return category **/ @ApiModelProperty(value = "") public Category getCategory() { return category; } - public void setCategory(Category category) { this.category = category; } - + public Pet name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - + public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); return this; } - - /** - * Get photoUrls - * @return photoUrls + + /** + * Get photoUrls + * @return photoUrls **/ @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } - + public Pet tags(List tags) { this.tags = tags; return this; } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { this.tags = new ArrayList(); } + this.tags.add(tagsItem); return this; } - - /** - * Get tags - * @return tags + + /** + * Get tags + * @return tags **/ @ApiModelProperty(value = "") public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } - + public Pet status(StatusEnum status) { this.status = status; return this; } - /** - * pet status in the store - * @return status + + /** + * pet status in the store + * @return status **/ @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -242,8 +237,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -270,5 +264,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index f6e025412de..c7c8eb90968 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -28,40 +28,39 @@ */ public class ReadOnlyFirst { - @SerializedName("bar") +@SerializedName("bar") private String bar = null; - @SerializedName("baz") private String baz = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; } - /** - * Get baz - * @return baz + + /** + * Get baz + * @return baz **/ @ApiModelProperty(value = "") public String getBaz() { return baz; } - public void setBaz(String baz) { this.baz = baz; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -79,8 +78,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, baz); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -103,5 +101,8 @@ private String toIndentedString(java.lang.Object o) { 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 e743292100b..3e2312615c2 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 @@ -28,28 +28,27 @@ */ public class SpecialModelName { - @SerializedName("$special[property.name]") - private Long specialPropertyName = null; - - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; +@SerializedName("$special[property.name]") + private Long $specialPropertyName = null; + + 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; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,22 +57,21 @@ public boolean equals(java.lang.Object o) { 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); } - - + @Override public String toString() { 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(); } @@ -89,5 +87,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Tag.java index bb6de58c8a1..b032d15676a 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Tag.java @@ -28,49 +28,47 @@ */ public class Tag { - @SerializedName("id") +@SerializedName("id") private Long id = null; - @SerializedName("name") private String name = null; - + public Tag id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Tag name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -88,8 +86,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -112,5 +109,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/User.java index 4ccb8a1c147..75e44e2ff37 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/User.java @@ -28,175 +28,167 @@ */ public class User { - @SerializedName("id") +@SerializedName("id") private Long id = null; - @SerializedName("username") private String username = null; - @SerializedName("firstName") private String firstName = null; - @SerializedName("lastName") private String lastName = null; - @SerializedName("email") private String email = null; - @SerializedName("password") private String password = null; - @SerializedName("phone") private String phone = null; - @SerializedName("userStatus") private Integer userStatus = null; - + public User id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public User username(String username) { this.username = username; return this; } - /** - * Get username - * @return username + + /** + * Get username + * @return username **/ @ApiModelProperty(value = "") public String getUsername() { return username; } - public void setUsername(String username) { this.username = username; } - + public User firstName(String firstName) { this.firstName = firstName; return this; } - /** - * Get firstName - * @return firstName + + /** + * Get firstName + * @return firstName **/ @ApiModelProperty(value = "") public String getFirstName() { return firstName; } - public void setFirstName(String firstName) { this.firstName = firstName; } - + public User lastName(String lastName) { this.lastName = lastName; return this; } - /** - * Get lastName - * @return lastName + + /** + * Get lastName + * @return lastName **/ @ApiModelProperty(value = "") public String getLastName() { return lastName; } - public void setLastName(String lastName) { this.lastName = lastName; } - + public User email(String email) { this.email = email; return this; } - /** - * Get email - * @return email + + /** + * Get email + * @return email **/ @ApiModelProperty(value = "") public String getEmail() { return email; } - public void setEmail(String email) { this.email = email; } - + public User password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - + public User phone(String phone) { this.phone = phone; return this; } - /** - * Get phone - * @return phone + + /** + * Get phone + * @return phone **/ @ApiModelProperty(value = "") public String getPhone() { return phone; } - public void setPhone(String phone) { this.phone = phone; } - + public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; } - /** - * User Status - * @return userStatus + + /** + * User Status + * @return userStatus **/ @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } - public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -220,8 +212,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -250,5 +241,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..6fdc3702e80 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 @@ -2,14 +2,17 @@ import io.swagger.client.ApiClient; import io.swagger.client.model.Client; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for AnotherFakeApi */ @@ -22,6 +25,8 @@ public void setup() { api = new ApiClient().createService(AnotherFakeApi.class); } + + /** * To test special tags * @@ -29,9 +34,13 @@ public void setup() { */ @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..559492405ac 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,15 +2,19 @@ import io.swagger.client.ApiClient; import java.math.BigDecimal; -import java.util.Date; +import io.swagger.client.model.Client; +import io.swagger.client.model.OuterComposite; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for FakeApi */ @@ -24,6 +28,82 @@ public void setup() { } + + /** + * + * + * Test serialization of outer boolean types + */ + @Test + public void fakeOuterBooleanSerializeTest() { + + Boolean body = null; + + // Boolean response = api.fakeOuterBooleanSerialize(body); + + // 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 + } + + /** + * 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 假端點 偽のエンドポイント 가짜 엔드 포인트 * @@ -31,21 +111,68 @@ public void setup() { */ @Test public void testEndpointParametersTest() { - BigDecimal number = null; - Double _double = null; - String string = 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 password = null; - // Void response = api.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); + + Object body = null; + + // Void response = api.testEndpointParameters(body); + + // TODO: test validations + } + + /** + * To test enum parameters + * + * To test enum parameters + */ + @Test + public void testEnumParametersTest() { + + Object body = null; + + List enumHeaderStringArray = null; + + String enumHeaderString = null; + + List enumQueryStringArray = null; + + String enumQueryString = null; + + Integer enumQueryInteger = null; + + // Void response = api.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); // TODO: test validations } + /** + * test inline additionalProperties + * + * + */ + @Test + public void testInlineAdditionalPropertiesTest() { + + Map body = null; + + // Void response = api.testInlineAdditionalProperties(body); + + // TODO: test validations + } + + /** + * test json serialization of form data + * + * + */ + @Test + public void testJsonFormDataTest() { + + Object body = null; + + // Void response = api.testJsonFormData(body); + + // 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..ab29f7ce6af 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 @@ -2,14 +2,17 @@ import io.swagger.client.ApiClient; import io.swagger.client.model.Client; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for FakeClassnameTags123Api */ @@ -23,6 +26,7 @@ public void setup() { } + /** * To test class name in snake case * @@ -30,10 +34,13 @@ public void setup() { */ @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 8fa02bed636..7b467b0b508 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,254 +1,158 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; -import io.swagger.client.CollectionFormats.*; -import io.swagger.client.model.*; +import io.swagger.client.model.ModelApiResponse; +import io.swagger.client.model.Pet; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; +import org.junit.Before; +import org.junit.Test; -import org.junit.*; -import okhttp3.MediaType; -import okhttp3.RequestBody; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; -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; + + // Void response = 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() { + + Integer petId = null; + + String apiKey = null; + + // Void response = 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() { + + Integer 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()); - - 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. - } - }); - } - }); - } + public void updatePetTest() { + + Pet pet = null; + + // Void response = api.updatePet(pet); - @Test - public void testUploadFile() throws Exception { - File file = File.createTempFile("test", "hello.txt"); - BufferedWriter writer = new BufferedWriter(new FileWriter(file)); - - writer.write("Hello world!"); - writer.close(); - - Pet pet = createRandomPet(); - api.addPet(pet).subscribe(SkeletonSubscriber.failTestOnError()); - - RequestBody body = RequestBody.create(MediaType.parse("text/plain"), file); - api.uploadFile(pet.getId(), "a test file", 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 } - + + /** + * Updates a pet in the store with form data + * + * + */ @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()); + public void updatePetWithFormTest() { + + Integer petId = null; + + Object body = null; + + // Void response = api.updatePetWithForm(petId, body); + + // TODO: test validations } - - 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; + + /** + * uploads an image + * + * + */ + @Test + public void uploadFileTest() { + + Integer petId = null; + + Object body = null; + + // ModelApiResponse response = api.uploadFile(petId, body); + + // 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..f59141e4eed 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,89 @@ 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.Map; -import org.junit.*; -import org.threeten.bp.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; -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; + + // Void response = 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() { + + Integer 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..2f011d503a5 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,153 @@ 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 java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; -import static org.junit.Assert.*; /** - * 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(); - - 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()); - } - }); - } - }); - } + public void createUserTest() { + + User user = null; + + // Void response = api.createUser(user); - @Test - public void testCreateUsersWithArray() throws Exception { - final User user1 = createUser(); - user1.setUsername("abc123"); - User user2 = createUser(); - user2.setUsername("123abc"); - - 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"); - - 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()); - } - }); + public void createUsersWithArrayInputTest() { + + List body = null; + + // Void response = api.createUsersWithArrayInput(body); + + // TODO: test validations } + + /** + * Creates list of users with given input array + * + * + */ + @Test + public void createUsersWithListInputTest() { + + List body = null; + + // Void response = api.createUsersWithListInput(body); + // 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); - - api.loginUser(user.getUsername(), user.getPassword()).subscribe(new SkeletonSubscriber() { - @Override - public void onNext(String token) { - assertTrue(token.startsWith("logged in user session:")); - } - }); + public void deleteUserTest() { + + String username = null; + + // Void response = api.deleteUser(username); + + // 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 logoutUser() throws Exception { - api.logoutUser(); + 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() { + + // Void response = api.logoutUser(); - 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 + } + + /** + * Updated user + * + * This can only be done by the logged in user. + */ + @Test + public void updateUserTest() { + + User user = null; + + String username = null; + + // Void response = api.updateUser(user, username); + + // TODO: test validations } -} \ No newline at end of file + + +} diff --git a/samples/client/petstore/java/retrofit2rx2/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit2rx2/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/client/petstore/java/retrofit2rx2/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/retrofit2rx2/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx2/build.gradle b/samples/client/petstore/java/retrofit2rx2/build.gradle index 22dff04b7d1..b7e0eae2318 100644 --- a/samples/client/petstore/java/retrofit2rx2/build.gradle +++ b/samples/client/petstore/java/retrofit2rx2/build.gradle @@ -32,8 +32,11 @@ if(hasProperty('target') && target == 'android') { targetSdkVersion 25 } compileOptions { + + sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 + } // Rename the aar correctly @@ -94,12 +97,19 @@ if(hasProperty('target') && target == 'android') { } ext { - oltu_version = "1.0.1" + oltu_version = "1.0.2" retrofit_version = "2.3.0" + swagger_annotations_version = "1.5.15" junit_version = "4.12" + + rx_java_version = "2.1.1" + + + threetenbp_version = "1.3.5" + json_fire_version = "1.8.0" } @@ -107,12 +117,19 @@ dependencies { compile "com.squareup.retrofit2:retrofit:$retrofit_version" compile "com.squareup.retrofit2:converter-scalars:$retrofit_version" compile "com.squareup.retrofit2:converter-gson:$retrofit_version" + + compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0' compile "io.reactivex.rxjava2:rxjava:$rx_java_version" + compile "io.swagger:swagger-annotations:$swagger_annotations_version" compile "org.apache.oltu.oauth2:org.apache.oltu.oauth2.client:$oltu_version" compile "io.gsonfire:gson-fire:$json_fire_version" + + compile "org.threeten:threetenbp:$threetenbp_version" + + testCompile "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/retrofit2rx2/build.sbt b/samples/client/petstore/java/retrofit2rx2/build.sbt index 89f22bca2a0..5975a33ef15 100644 --- a/samples/client/petstore/java/retrofit2rx2/build.sbt +++ b/samples/client/petstore/java/retrofit2rx2/build.sbt @@ -11,12 +11,21 @@ lazy val root = (project in file(".")). libraryDependencies ++= Seq( "com.squareup.retrofit2" % "retrofit" % "2.3.0" % "compile", "com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile", + "com.squareup.retrofit2" % "converter-gson" % "2.3.0" % "compile", + + + + "com.squareup.retrofit2" % "adapter-rxjava2" % "2.3.0" % "compile", "io.reactivex.rxjava2" % "rxjava" % "2.1.1" % "compile", + "io.swagger" % "swagger-annotations" % "1.5.15" % "compile", - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2" % "compile", + + "org.threeten" % "threetenbp" % "1.3.5" % "compile", + "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" diff --git a/samples/client/petstore/java/retrofit2rx2/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/retrofit2rx2/docs/AdditionalPropertiesClass.md index 0437c4dd8cc..b37862da7cf 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/AdditionalPropertiesClass.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/Animal.md b/samples/client/petstore/java/retrofit2rx2/docs/Animal.md index b3f325c3524..346caaf63f4 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/Animal.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/Animal.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/AnimalFarm.md b/samples/client/petstore/java/retrofit2rx2/docs/AnimalFarm.md deleted file mode 100644 index c7c7f1ddcce..00000000000 --- a/samples/client/petstore/java/retrofit2rx2/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ - -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - diff --git a/samples/client/petstore/java/retrofit2rx2/docs/AnotherFakeApi.md b/samples/client/petstore/java/retrofit2rx2/docs/AnotherFakeApi.md index bcc1a3a45ce..792799b51e8 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/AnotherFakeApi.md @@ -7,9 +7,11 @@ Method | HTTP request | Description [**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** another-fake/dummy | To test special tags + + # **testSpecialTags** -> Client testSpecialTags(body) +> Client testSpecialTags(client) To test special tags @@ -22,10 +24,13 @@ To test special tags //import io.swagger.client.api.AnotherFakeApi; + AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +42,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -52,3 +58,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/retrofit2rx2/docs/ArrayOfArrayOfNumberOnly.md index 77292549927..3671a5e9190 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/ArrayOfArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/retrofit2rx2/docs/ArrayOfNumberOnly.md index e8cc4cd36dc..30b9b6648f4 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/ArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/ArrayTest.md b/samples/client/petstore/java/retrofit2rx2/docs/ArrayTest.md index 9feee16427f..4ab76343030 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/ArrayTest.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/ArrayTest.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/Capitalization.md b/samples/client/petstore/java/retrofit2rx2/docs/Capitalization.md index 0f3064c1996..9af7864f97e 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/Capitalization.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/Capitalization.md @@ -13,3 +13,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/Cat.md b/samples/client/petstore/java/retrofit2rx2/docs/Cat.md index 6e9f71ce7dd..5e408344021 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/Cat.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/Cat.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **declawed** | **Boolean** | | [optional] + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/Category.md b/samples/client/petstore/java/retrofit2rx2/docs/Category.md index e2df0803278..deb5a3e2a52 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/Category.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/Category.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/ClassModel.md b/samples/client/petstore/java/retrofit2rx2/docs/ClassModel.md index 64f880c8786..49c281cc0ed 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/ClassModel.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/ClassModel.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/Client.md b/samples/client/petstore/java/retrofit2rx2/docs/Client.md index 5c490ea166c..52b2f72c79c 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/Client.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/Client.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/Dog.md b/samples/client/petstore/java/retrofit2rx2/docs/Dog.md index ac7cea323ff..00e6446e9f5 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/Dog.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/Dog.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **breed** | **String** | | [optional] + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/EnumArrays.md b/samples/client/petstore/java/retrofit2rx2/docs/EnumArrays.md index 4dddc0bfd27..939a0e69587 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/EnumArrays.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/EnumArrays.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] + ## Enum: JustSymbolEnum Name | Value @@ -20,8 +21,6 @@ DOLLAR | "$" ## Enum: List<ArrayEnumEnum> Name | Value ---- | ----- -FISH | "fish" -CRAB | "crab" diff --git a/samples/client/petstore/java/retrofit2rx2/docs/EnumTest.md b/samples/client/petstore/java/retrofit2rx2/docs/EnumTest.md index 08fee344882..9722c621962 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/EnumTest.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/EnumTest.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] + ## Enum: EnumStringEnum Name | Value diff --git a/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md b/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md index 3e052dea273..6d1d77bdf10 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/FakeApi.md @@ -15,6 +15,8 @@ Method | HTTP request | Description [**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** fake/jsonFormData | test json serialization of form data + + # **fakeOuterBooleanSerialize** > Boolean fakeOuterBooleanSerialize(body) @@ -30,8 +32,11 @@ Test serialization of outer boolean types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body + +Boolean body = ; // Boolean | Input boolean as post body + try { Boolean result = apiInstance.fakeOuterBooleanSerialize(body); System.out.println(result); @@ -47,6 +52,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + ### Return type **Boolean** @@ -57,12 +63,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outercomposite) @@ -75,10 +82,13 @@ Test serialization of object with outer number type //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body + +OuterComposite 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 +100,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outercomposite** | [**OuterComposite**](.md)| Input composite as post body | [optional] + ### Return type @@ -102,8 +113,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterNumberSerialize** @@ -120,8 +132,11 @@ Test serialization of outer number types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body + +BigDecimal body = ; // BigDecimal | Input number as post body + try { BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); System.out.println(result); @@ -137,6 +152,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + ### Return type [**BigDecimal**](BigDecimal.md) @@ -147,8 +163,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterStringSerialize** @@ -165,8 +182,11 @@ Test serialization of outer string types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String body = "body_example"; // String | Input string as post body + +String body = ; // String | Input string as post body + try { String result = apiInstance.fakeOuterStringSerialize(body); System.out.println(result); @@ -182,6 +202,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**String**](String.md)| Input string as post body | [optional] + ### Return type **String** @@ -192,12 +213,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -210,10 +232,13 @@ To test \"client\" model //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +250,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -240,9 +266,10 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + # **testEndpointParameters** -> Void testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) +> Void testEndpointParameters(body) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -251,36 +278,17 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### 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.FakeApi; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure HTTP basic authorization: http_basic_test -HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); -http_basic_test.setUsername("YOUR USERNAME"); -http_basic_test.setPassword("YOUR PASSWORD"); 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 -Integer integer = 56; // Integer | None -Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None -Float _float = 3.4F; // Float | None -String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None -LocalDate date = new LocalDate(); // LocalDate | None -OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None -String password = "password_example"; // String | None -String paramCallback = "paramCallback_example"; // String | None + +Object body = ; // Object | + try { - Void result = apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + Void result = apiInstance.testEndpointParameters(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEndpointParameters"); @@ -292,20 +300,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **BigDecimal**| None | - **_double** | **Double**| None | - **patternWithoutDelimiter** | **String**| None | - **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] - **int64** | **Long**| None | [optional] - **_float** | **Float**| None | [optional] - **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] - **date** | **LocalDate**| None | [optional] - **dateTime** | **OffsetDateTime**| None | [optional] - **password** | **String**| None | [optional] - **paramCallback** | **String**| None | [optional] + **body** | [**Object**](Object.md)| | + ### Return type @@ -318,11 +314,12 @@ Name | Type | Description | Notes ### 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 + - **Accept**: Not defined + # **testEnumParameters** -> Void testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> Void testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger) To test enum parameters @@ -335,17 +332,23 @@ To test enum parameters //import io.swagger.client.api.FakeApi; + 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) + +Object body = ; // Object | + List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) -String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + +String enumHeaderString = Arrays.asList("enumHeaderString_example"); // 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) + +String enumQueryString = Arrays.asList("enumQueryString_example"); // String | Query parameter enum test (string) + +Integer enumQueryInteger = Arrays.asList(56); // Integer | Query parameter enum test (double) + try { - Void result = apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + Void result = apiInstance.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); @@ -357,14 +360,13 @@ 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] + **body** | [**Object**](Object.md)| | [optional] + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: ] + **enumHeaderString** | [**String**](.md)| Header parameter enum test (string) | [optional] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: ] + **enumQueryString** | [**String**](.md)| Query parameter enum test (string) | [optional] + **enumQueryInteger** | [**Integer**](.md)| Query parameter enum test (double) | [optional] + ### Return type @@ -377,16 +379,15 @@ No authorization required ### HTTP request headers - **Content-Type**: */* - - **Accept**: */* + - **Accept**: Not defined + # **testInlineAdditionalProperties** -> Void testInlineAdditionalProperties(param) +> Void testInlineAdditionalProperties(body) test inline additionalProperties - - ### Example ```java // Import classes: @@ -394,10 +395,13 @@ test inline additionalProperties //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body + +Map body = ; // Map | request body + try { - Void result = apiInstance.testInlineAdditionalProperties(param); + Void result = apiInstance.testInlineAdditionalProperties(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); @@ -409,7 +413,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | + **body** | [**Map<String, String>**](Map.md)| request body | + ### Return type @@ -424,14 +429,13 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined + # **testJsonFormData** -> Void testJsonFormData(param, param2) +> Void testJsonFormData(body) test json serialization of form data - - ### Example ```java // Import classes: @@ -439,11 +443,13 @@ test json serialization of form data //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String param = "param_example"; // String | field1 -String param2 = "param2_example"; // String | field2 + +Object body = ; // Object | + try { - Void result = apiInstance.testJsonFormData(param, param2); + Void result = apiInstance.testJsonFormData(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testJsonFormData"); @@ -455,8 +461,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **String**| field1 | - **param2** | **String**| field2 | + **body** | [**Object**](Object.md)| | + ### Return type @@ -471,3 +477,5 @@ No authorization required - **Content-Type**: application/json - **Accept**: Not defined + + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/retrofit2rx2/docs/FakeClassnameTags123Api.md index 715fed0dc0b..2336289e187 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/FakeClassnameTags123Api.md @@ -7,33 +7,28 @@ Method | HTTP request | Description [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** fake_classname_test | To test class name in snake case + + # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case ### 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.FakeClassnameTags123Api; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure API key authorization: api_key_query -ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); -api_key_query.setApiKey("YOUR API KEY"); -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model + +Client 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 +40,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -60,3 +56,5 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/FormatTest.md b/samples/client/petstore/java/retrofit2rx2/docs/FormatTest.md index c7a3acb3cb7..bc11b93cb26 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/FormatTest.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/FormatTest.md @@ -11,8 +11,8 @@ Name | Type | Description | Notes **_float** | **Float** | | [optional] **_double** | **Double** | | [optional] **string** | **String** | | [optional] -**_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**_byte** | **String** | | +**binary** | **String** | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] @@ -20,3 +20,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/retrofit2rx2/docs/HasOnlyReadOnly.md index c1d0aac5672..5564ddcf28a 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/HasOnlyReadOnly.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/MapTest.md b/samples/client/petstore/java/retrofit2rx2/docs/MapTest.md index 714a97a40d9..74a6fe8ae70 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/MapTest.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/MapTest.md @@ -8,12 +8,11 @@ Name | Type | Description | Notes **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] + ## Enum: Map<String, InnerEnum> Name | Value ---- | ----- -UPPER | "UPPER" -LOWER | "lower" diff --git a/samples/client/petstore/java/retrofit2rx2/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/retrofit2rx2/docs/MixedPropertiesAndAdditionalPropertiesClass.md index b12e2cd70e6..4507481b5a9 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/Model200Response.md b/samples/client/petstore/java/retrofit2rx2/docs/Model200Response.md index 5b3a9a0e46d..8d2cc50bb83 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/Model200Response.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/Model200Response.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/ModelApiResponse.md b/samples/client/petstore/java/retrofit2rx2/docs/ModelApiResponse.md index 3eec8686cc9..06052b202f1 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/ModelApiResponse.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/ModelApiResponse.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/ModelReturn.md b/samples/client/petstore/java/retrofit2rx2/docs/ModelReturn.md index a679b04953e..a7845ba254b 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/ModelReturn.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/ModelReturn.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/Name.md b/samples/client/petstore/java/retrofit2rx2/docs/Name.md index ce2fb4dee50..a8d6fec9714 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/Name.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/Name.md @@ -11,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/NumberOnly.md b/samples/client/petstore/java/retrofit2rx2/docs/NumberOnly.md index a3feac7fadc..adfb36a95bb 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/NumberOnly.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/NumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/Order.md b/samples/client/petstore/java/retrofit2rx2/docs/Order.md index 268c617d1ff..7e4beff6df1 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/Order.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/Order.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/retrofit2rx2/docs/OuterComposite.md b/samples/client/petstore/java/retrofit2rx2/docs/OuterComposite.md index 3f5a633c998..1963c7a0f73 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/OuterComposite.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/OuterComposite.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/Pet.md b/samples/client/petstore/java/retrofit2rx2/docs/Pet.md index 5b63109ef92..1492195a58d 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/Pet.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/Pet.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/retrofit2rx2/docs/PetApi.md b/samples/client/petstore/java/retrofit2rx2/docs/PetApi.md index ea3c05ad412..c5748bb7cd3 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/PetApi.md @@ -14,33 +14,28 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** pet/{petId}/uploadImage | uploads an image + + # **addPet** -> Void addPet(body) +> Void addPet(pet) 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 + +Pet pet = ; // Pet | Pet object that needs to be added to the store + try { - Void result = apiInstance.addPet(body); + Void result = apiInstance.addPet(pet); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); @@ -52,7 +47,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -65,7 +61,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **deletePet** @@ -73,26 +70,20 @@ Name | Type | Description | Notes 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 | + +Integer petId = Arrays.asList(56); // Integer | Pet id to delete + +String apiKey = Arrays.asList("apiKey_example"); // String | + try { Void result = apiInstance.deletePet(petId, apiKey); System.out.println(result); @@ -106,8 +97,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | - **apiKey** | **String**| | [optional] + **petId** | [**Integer**](.md)| Pet id to delete | + **apiKey** | [**String**](.md)| | [optional] + ### Return type @@ -120,7 +112,8 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **findPetsByStatus** @@ -133,20 +126,15 @@ 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); @@ -160,7 +148,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: ] + ### Return type @@ -175,6 +164,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **findPetsByTags** > List<Pet> findPetsByTags(tags) @@ -186,20 +176,15 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### 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); @@ -215,6 +200,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | + ### Return type [**List<Pet>**](Pet.md) @@ -228,6 +214,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **getPetById** > Pet getPetById(petId) @@ -239,22 +226,15 @@ 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to return + try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -268,7 +248,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to return | + **petId** | [**Integer**](.md)| ID of pet to return | + ### Return type @@ -283,33 +264,27 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **updatePet** -> Void updatePet(body) +> Void updatePet(pet) 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 + +Pet pet = ; // Pet | Pet object that needs to be added to the store + try { - Void result = apiInstance.updatePet(body); + Void result = apiInstance.updatePet(pet); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); @@ -321,7 +296,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -334,37 +310,31 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updatePetWithForm** -> Void updatePetWithForm(petId, name, status) +> Void updatePetWithForm(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet that needs to be updated + +Object body = ; // Object | + try { - Void result = apiInstance.updatePetWithForm(petId, name, status); + Void result = apiInstance.updatePetWithForm(petId, body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePetWithForm"); @@ -376,9 +346,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet that needs to be updated | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -391,37 +361,31 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **uploadFile** -> ModelApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to update + +Object body = ; // Object | + try { - ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); + ModelApiResponse result = apiInstance.uploadFile(petId, body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFile"); @@ -433,9 +397,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet to update | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -450,3 +414,5 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json + + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/ReadOnlyFirst.md b/samples/client/petstore/java/retrofit2rx2/docs/ReadOnlyFirst.md index 426b7cde95a..57655e5b49e 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/ReadOnlyFirst.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/SpecialModelName.md b/samples/client/petstore/java/retrofit2rx2/docs/SpecialModelName.md index c2c6117c552..f4259d2a73c 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/SpecialModelName.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/SpecialModelName.md @@ -4,7 +4,8 @@ ## 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 134f0c36578..35b66fd8485 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/StoreApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/StoreApi.md @@ -10,6 +10,8 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** store/order | Place an order for a pet + + # **deleteOrder** > Void deleteOrder(orderId) @@ -25,8 +27,11 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + +String orderId = Arrays.asList("orderId_example"); // String | ID of the order that needs to be deleted + try { Void result = apiInstance.deleteOrder(orderId); System.out.println(result); @@ -40,7 +45,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | + **orderId** | [**String**](.md)| ID of the order that needs to be deleted | + ### Return type @@ -53,7 +59,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getInventory** @@ -66,21 +73,13 @@ 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); @@ -93,6 +92,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type **Map<String, Integer>** @@ -106,6 +106,7 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json + # **getOrderById** > Order getOrderById(orderId) @@ -121,8 +122,11 @@ For valid response try integer IDs with value <= 5 or > 10. Other val //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched + +Integer orderId = Arrays.asList(56); // Integer | ID of pet that needs to be fetched + try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -136,7 +140,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | [**Integer**](.md)| ID of pet that needs to be fetched | + ### Return type @@ -151,14 +156,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -166,10 +170,13 @@ Place an order for a pet //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet + +Order 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"); @@ -181,7 +188,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](.md)| order placed for purchasing the pet | + ### Return type @@ -193,6 +201,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: */* - **Accept**: application/xml, application/json + + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/Tag.md b/samples/client/petstore/java/retrofit2rx2/docs/Tag.md index de6814b55d5..7a97d4c6812 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/Tag.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/Tag.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/User.md b/samples/client/petstore/java/retrofit2rx2/docs/User.md index 8b6753dd284..cf7f9ce1312 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/User.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/User.md @@ -15,3 +15,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/UserApi.md b/samples/client/petstore/java/retrofit2rx2/docs/UserApi.md index 40096ec05bc..619b98b9fa7 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/UserApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/UserApi.md @@ -14,9 +14,11 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** user/{username} | Updated user + + # **createUser** -> Void createUser(body) +> Void createUser(user) Create user @@ -29,10 +31,13 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object + +User user = ; // User | Created user object + try { - Void result = apiInstance.createUser(body); + Void result = apiInstance.createUser(user); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); @@ -44,7 +49,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](.md)| Created user object | + ### Return type @@ -56,8 +62,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithArrayInput** @@ -65,8 +72,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -74,8 +79,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { Void result = apiInstance.createUsersWithArrayInput(body); System.out.println(result); @@ -91,6 +99,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type [**Void**](.md) @@ -101,8 +110,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithListInput** @@ -110,8 +120,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -119,8 +127,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { Void result = apiInstance.createUsersWithListInput(body); System.out.println(result); @@ -136,6 +147,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type [**Void**](.md) @@ -146,8 +158,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **deleteUser** @@ -164,8 +177,11 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be deleted + +String username = Arrays.asList("username_example"); // String | The name that needs to be deleted + try { Void result = apiInstance.deleteUser(username); System.out.println(result); @@ -179,7 +195,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | + **username** | [**String**](.md)| The name that needs to be deleted | + ### Return type @@ -192,7 +209,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getUserByName** @@ -200,8 +218,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -209,8 +225,11 @@ Get user by user name //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. + +String username = Arrays.asList("username_example"); // String | The name that needs to be fetched. Use user1 for testing. + try { User result = apiInstance.getUserByName(username); System.out.println(result); @@ -224,7 +243,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + **username** | [**String**](.md)| The name that needs to be fetched. Use user1 for testing. | + ### Return type @@ -239,14 +259,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **loginUser** > String loginUser(username, password) Logs user into the system - - ### Example ```java // Import classes: @@ -254,9 +273,13 @@ Logs user into the system //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 + +String username = Arrays.asList("username_example"); // String | The user name for login + +String password = Arrays.asList("password_example"); // String | The password for login in clear text + try { String result = apiInstance.loginUser(username, password); System.out.println(result); @@ -270,8 +293,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | + **username** | [**String**](.md)| The user name for login | + **password** | [**String**](.md)| The password for login in clear text | + ### Return type @@ -286,14 +310,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **logoutUser** > Void logoutUser() Logs out current logged in user session - - ### Example ```java // Import classes: @@ -301,7 +324,9 @@ Logs out current logged in user session //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); + try { Void result = apiInstance.logoutUser(); System.out.println(result); @@ -314,6 +339,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type [**Void**](.md) @@ -325,11 +351,12 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updateUser** -> Void updateUser(username, body) +> Void updateUser(user, username) Updated user @@ -342,11 +369,15 @@ This can only be done by the logged in user. //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 + +User user = ; // User | Updated user object + +String username = Arrays.asList("username_example"); // String | name that need to be deleted + try { - Void result = apiInstance.updateUser(username, body); + Void result = apiInstance.updateUser(user, username); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); @@ -358,8 +389,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](.md)| Updated user object | + **username** | [**String**](.md)| name that need to be deleted | + ### Return type @@ -371,6 +403,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + + diff --git a/samples/client/petstore/java/retrofit2rx2/git_push.sh b/samples/client/petstore/java/retrofit2rx2/git_push.sh index ae01b182ae9..ed374619b13 100644 --- a/samples/client/petstore/java/retrofit2rx2/git_push.sh +++ b/samples/client/petstore/java/retrofit2rx2/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 credential in your environment." + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential 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/retrofit2rx2/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/retrofit2rx2/gradle/wrapper/gradle-wrapper.jar index 2c6137b8789..e69de29bb2d 100644 Binary files a/samples/client/petstore/java/retrofit2rx2/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/retrofit2rx2/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/retrofit2rx2/pom.xml b/samples/client/petstore/java/retrofit2rx2/pom.xml index 2c9352e5647..0bbb2807087 100644 --- a/samples/client/petstore/java/retrofit2rx2/pom.xml +++ b/samples/client/petstore/java/retrofit2rx2/pom.xml @@ -1,260 +1,256 @@ - 4.0.0 - io.swagger - swagger-petstore-retrofit2-rx2 - jar - swagger-petstore-retrofit2-rx2 - 1.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 + io.swagger + swagger-petstore-retrofit2-rx2 + jar + swagger-petstore-retrofit2-rx2 + 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 - 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 + - - - 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 - - + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + - - - - 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.2 - - - - jar - test-jar - - - - - - + + + + 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.codehaus.mojo - build-helper-maven-plugin - 1.10 - - - 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-javadoc-plugin - 2.10.4 - - - attach-javadocs - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - - - + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + jar + test-jar + + + + + + - - - sign-artifacts - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - - - - - + + org.codehaus.mojo + build-helper-maven-plugin + 1.10 + + + 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-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} - - - com.squareup.retrofit2 - converter-gson - ${retrofit-version} - - - com.squareup.retrofit2 - retrofit - ${retrofit-version} - - - com.squareup.retrofit2 - converter-scalars - ${retrofit-version} - - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - ${oltu-version} - - - io.gsonfire - gson-fire - ${gson-fire-version} - - - org.threeten - threetenbp - ${threetenbp-version} - - - io.reactivex.rxjava2 - rxjava - ${rxjava-version} - - - com.squareup.retrofit2 - adapter-rxjava2 - ${retrofit-version} - + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + io.swagger + swagger-annotations + ${swagger-core-version} + + + com.squareup.retrofit2 + converter-gson + ${retrofit-version} + + + com.squareup.retrofit2 + retrofit + ${retrofit-version} + + + com.squareup.retrofit2 + converter-scalars + ${retrofit-version} + + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + ${oltu-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + + + org.threeten + threetenbp + ${threetenbp-version} + + + + + + io.reactivex.rxjava2 + rxjava + ${rxjava-version} + + + com.squareup.retrofit2 + adapter-rxjava2 + ${retrofit-version} + + + + + - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.7 - ${java.version} - ${java.version} - 1.8.0 - 1.5.15 - 2.3.0 - 2.1.1 - 1.3.5 - 1.0.1 - 4.12 - + + + junit + junit + ${junit-version} + test + + + + UTF-8 + 1.7 + ${java.version} + ${java.version} + 1.8.0 + 1.5.15 + + 2.3.0 + + + 2.1.1 + + + + 1.3.5 + + 1.0.2 + 4.12 + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/ApiClient.java index a2bddc86934..cc038fb7d7f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/ApiClient.java @@ -9,10 +9,16 @@ import okhttp3.ResponseBody; import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder; import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder; + + import org.threeten.bp.format.DateTimeFormatter; + import retrofit2.Converter; import retrofit2.Retrofit; + + import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory; + import retrofit2.converter.gson.GsonConverterFactory; import retrofit2.converter.scalars.ScalarsConverterFactory; import io.swagger.client.auth.HttpBasicAuth; @@ -25,6 +31,7 @@ import java.lang.annotation.Annotation; import java.lang.reflect.Type; import java.text.DateFormat; + import java.util.LinkedHashMap; import java.util.Map; import java.util.HashMap; @@ -44,20 +51,39 @@ public ApiClient() { public ApiClient(String[] authNames) { this(); for(String authName : authNames) { + Interceptor auth; if ("api_key".equals(authName)) { + + auth = new ApiKeyAuth("header", "api_key"); + + } else if ("api_key_query".equals(authName)) { + + auth = new ApiKeyAuth("query", "api_key_query"); + + } else if ("http_basic_test".equals(authName)) { + auth = new HttpBasicAuth(); + + + } else if ("petstore_auth".equals(authName)) { - auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets"); + + + + auth = new OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", ""); + } else { throw new RuntimeException("auth name \"" + authName + "\" not found in available auth names"); } addAuthorization(authName, auth); + + } } @@ -118,8 +144,9 @@ public void createDefaultAdapter() { adapterBuilder = new Retrofit .Builder() .baseUrl(baseUrl) - + .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) + .addConverterFactory(ScalarsConverterFactory.create()) .addConverterFactory(GsonCustomConverterFactory.create(json.getGson())); } @@ -141,6 +168,8 @@ public ApiClient setSqlDateFormat(DateFormat dateFormat) { return this; } + + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { this.json.setOffsetDateTimeFormat(dateFormat); return this; @@ -151,6 +180,7 @@ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { return this; } + /** * Helper method to configure the first api key found 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..1f72d74749f 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 @@ -23,10 +23,13 @@ import com.google.gson.JsonElement; import io.gsonfire.GsonFireBuilder; import io.gsonfire.TypeSelector; + + import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import org.threeten.bp.format.DateTimeFormatter; + import io.swagger.client.model.*; import java.io.IOException; @@ -35,6 +38,7 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; + import java.util.Date; import java.util.Map; import java.util.HashMap; @@ -43,23 +47,31 @@ public class JSON { private Gson gson; private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + + private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + public static GsonBuilder createGson() { GsonFireBuilder fireBuilder = new GsonFireBuilder() + .registerTypeSelector(Animal.class, new TypeSelector() { @Override public Class getClassForElement(JsonElement readElement) { Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("Cat".toUpperCase(), Cat.class); + classByDiscriminatorValue.put("Dog".toUpperCase(), Dog.class); + classByDiscriminatorValue.put("Animal".toUpperCase(), Animal.class); return getClassByDiscriminator( classByDiscriminatorValue, - getDiscriminatorValue(readElement, "className")); + getDiscriminatorValue(readElement, "Discriminator{propertyName='className', mapping=null}")); } }) + ; return fireBuilder.createGsonBuilder(); } @@ -84,8 +96,11 @@ public JSON() { gson = createGson() .registerTypeAdapter(Date.class, dateTypeAdapter) .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) + + .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) + .create(); } @@ -109,6 +124,8 @@ public JSON setGson(Gson gson) { return this; } + + /** * Gson TypeAdapter for JSR310 OffsetDateTime type */ @@ -204,6 +221,7 @@ public JSON setLocalDateFormat(DateTimeFormatter dateFormat) { return this; } + /** * Gson TypeAdapter for java.sql.Date type * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used 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 a9eb671bfe0..68038a3e840 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 @@ -2,7 +2,11 @@ import io.swagger.client.CollectionFormats.*; + + import io.reactivex.Observable; + + import retrofit2.http.*; import okhttp3.RequestBody; @@ -10,24 +14,41 @@ import io.swagger.client.model.Client; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + 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({ "Content-Type:application/json" }) + + + @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 37673eac589..ea9b1774e86 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 @@ -2,7 +2,11 @@ import io.swagger.client.CollectionFormats.*; + + import io.reactivex.Observable; + + import retrofit2.http.*; import okhttp3.RequestBody; @@ -10,143 +14,255 @@ 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 java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public interface FakeApi { + /** * * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Call<Boolean> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("fake/outer/boolean") Observable fakeOuterBooleanSerialize( @retrofit2.http.Body Boolean body ); + /** * * 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> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("fake/outer/composite") Observable fakeOuterCompositeSerialize( - @retrofit2.http.Body OuterComposite body + @retrofit2.http.Body OuterComposite outercomposite ); + /** * * Test serialization of outer number types + * @param body Input number as post body (optional) + * @return Call<BigDecimal> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("fake/outer/number") Observable fakeOuterNumberSerialize( @retrofit2.http.Body BigDecimal body ); + /** * * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return Call<String> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("fake/outer/string") Observable fakeOuterStringSerialize( @retrofit2.http.Body String body ); + /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + + * @param client client model (required) + * @return Call<Client> + */ + + + + @Headers({ "Content-Type:application/json" }) + + + @PATCH("fake") Observable testClientModel( - @retrofit2.http.Body Client body + @retrofit2.http.Body Client client ); + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) + + * @param body (required) + * @return Call<Void> + */ - @retrofit2.http.FormUrlEncoded + + + + + @Headers({ + "Content-Type:application/json; charset=utf-8" + }) + + + + + @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.Body Object body ); + /** * 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 body (optional) + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + + * @param enumHeaderString Header parameter enum test (string) (optional) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + + * @param enumQueryString Query parameter enum test (string) (optional) + * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) + * @return Call<Void> + */ - @retrofit2.http.FormUrlEncoded + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @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.Body Object body, @retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Path("enum_query_string_array") List enumQueryStringArray, @retrofit2.http.Path("enum_query_string") String enumQueryString, @retrofit2.http.Path("enum_query_integer") Integer enumQueryInteger ); + /** * test inline additionalProperties * - * @param param request body (required) + + * @param body request body (required) + * @return Call<Void> + */ + + + + @Headers({ "Content-Type:application/json" }) + + + @POST("fake/inline-additionalProperties") Observable testInlineAdditionalProperties( - @retrofit2.http.Body Object param + @retrofit2.http.Body Map body ); + /** * test json serialization of form data * - * @param param field1 (required) - * @param param2 field2 (required) + + * @param body (required) + * @return Call<Void> + */ - @retrofit2.http.FormUrlEncoded + + + + + @Headers({ + "Content-Type:application/json" + }) + + + @GET("fake/jsonFormData") Observable testJsonFormData( - @retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2 + @retrofit2.http.Body Object body ); + } + 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 6e7e3555a21..a6a0763d530 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 @@ -2,7 +2,11 @@ import io.swagger.client.CollectionFormats.*; + + import io.reactivex.Observable; + + import retrofit2.http.*; import okhttp3.RequestBody; @@ -10,24 +14,41 @@ import io.swagger.client.model.Client; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public interface FakeClassnameTags123Api { + /** * To test class name in snake case * - * @param body client model (required) + + * @param client client model (required) + * @return Call<Client> + */ + + + + @Headers({ "Content-Type:application/json" }) + + + @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 e3c9fbf2581..e9b0dd8f218 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 @@ -2,121 +2,209 @@ import io.swagger.client.CollectionFormats.*; + + import io.reactivex.Observable; + + import retrofit2.http.*; import okhttp3.RequestBody; import okhttp3.ResponseBody; -import java.io.File; import io.swagger.client.model.ModelApiResponse; import io.swagger.client.model.Pet; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + 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({ "Content-Type:application/json" }) + + + + + @POST("pet") Observable addPet( - @retrofit2.http.Body Pet body + @retrofit2.http.Body Pet pet ); + /** * Deletes a pet * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Call<Void> + */ + + + + @DELETE("pet/{petId}") Observable deletePet( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Header("api_key") String apiKey + @retrofit2.http.Path("petId") Integer petId, @retrofit2.http.Header("api_key") String apiKey ); + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @return Call<List<Pet>> + */ + + + + @GET("pet/findByStatus") Observable> findPetsByStatus( - @retrofit2.http.Query("status") CSVParams status + @retrofit2.http.Path("status") List status ); + /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @return Call<List<Pet>> + */ + + + + @GET("pet/findByTags") Observable> findPetsByTags( - @retrofit2.http.Query("tags") CSVParams tags + @retrofit2.http.Path("tags") List tags ); + /** * Find pet by ID * Returns a single pet + * @param petId ID of pet to return (required) + * @return Call<Pet> + */ + + + + @GET("pet/{petId}") Observable getPetById( - @retrofit2.http.Path("petId") Long petId + @retrofit2.http.Path("petId") Integer petId ); + /** * 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({ "Content-Type:application/json" }) + + + + + @PUT("pet") Observable updatePet( - @retrofit2.http.Body Pet body + @retrofit2.http.Body Pet pet ); + /** * Updates a pet in the store with form data * + * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) + + * @param body (optional) + * @return Call<Void> + */ - @retrofit2.http.FormUrlEncoded + + + + + @Headers({ + "Content-Type:application/x-www-form-urlencoded" + }) + + + @POST("pet/{petId}") Observable updatePetWithForm( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Field("name") String name, @retrofit2.http.Field("status") String status + @retrofit2.http.Path("petId") Integer petId, @retrofit2.http.Body Object body ); + /** * uploads an image * + * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) + + * @param body (optional) + * @return Call<ModelApiResponse> + */ - @retrofit2.http.Multipart + + + + @POST("pet/{petId}/uploadImage") Observable uploadFile( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part("file\"; filename=\"file") RequestBody file + @retrofit2.http.Path("petId") Integer petId, @retrofit2.http.Body Object body ); + } + 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 746909cce01..9596e9b8da2 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 @@ -2,7 +2,11 @@ import io.swagger.client.CollectionFormats.*; + + import io.reactivex.Observable; + + import retrofit2.http.*; import okhttp3.RequestBody; @@ -10,52 +14,95 @@ import io.swagger.client.model.Order; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public interface StoreApi { + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @return Call<Void> + */ + + + + @DELETE("store/order/{order_id}") Observable deleteOrder( @retrofit2.http.Path("order_id") String orderId ); + /** * Returns pet inventories by status * Returns a map of status codes to quantities + * @return Call<Map<String, Integer>> + */ + + + + @GET("store/inventory") Observable> getInventory(); + /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @return Call<Order> + */ + + + + @GET("store/order/{order_id}") Observable getOrderById( - @retrofit2.http.Path("order_id") Long orderId + @retrofit2.http.Path("order_id") Integer orderId ); + /** * 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> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @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 1997f4c6cfb..445072e7c76 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 @@ -2,7 +2,11 @@ import io.swagger.client.CollectionFormats.*; + + import io.reactivex.Observable; + + import retrofit2.http.*; import okhttp3.RequestBody; @@ -10,98 +14,193 @@ import io.swagger.client.model.User; + + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + 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> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @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) + * @return Call<Void> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("user/createWithArray") Observable createUsersWithArrayInput( @retrofit2.http.Body List body ); + /** * Creates list of users with given input array * + * @param body List of user object (required) + * @return Call<Void> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @POST("user/createWithList") Observable createUsersWithListInput( @retrofit2.http.Body List body ); + /** * Delete user * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @return Call<Void> + */ + + + + @DELETE("user/{username}") Observable deleteUser( @retrofit2.http.Path("username") String username ); + /** * Get user by user name * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return Call<User> + */ + + + + @GET("user/{username}") Observable getUserByName( @retrofit2.http.Path("username") String username ); + /** * Logs user into the system * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return Call<String> + */ + + + + @GET("user/login") Observable loginUser( - @retrofit2.http.Query("username") String username, @retrofit2.http.Query("password") String password + @retrofit2.http.Path("username") String username, @retrofit2.http.Path("password") String password ); + /** * Logs out current logged in user session * + * @return Call<Void> + */ + + + + @GET("user/logout") Observable logoutUser(); + /** * Updated user * This can only be done by the logged in user. + + * @param user Updated user object (required) + * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @return Call<Void> + */ + + + + + @Headers({ + "Content-Type:*/*" + }) + + + @PUT("user/{username}") Observable updateUser( - @retrofit2.http.Path("username") String username, @retrofit2.http.Body User body + @retrofit2.http.Body User user, @retrofit2.http.Path("username") String username ); + } + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/auth/OAuthOkHttpClient.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/auth/OAuthOkHttpClient.java index c9b6e124d51..ab5acf4cc53 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/auth/OAuthOkHttpClient.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/auth/OAuthOkHttpClient.java @@ -59,6 +59,7 @@ public T execute(OAuthClientRequest request, Map response.body().string(), response.body().contentType().toString(), response.code(), + response.headers().toMultimap(), responseClass); } catch (IOException e) { throw new OAuthSystemException(e); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index b302fdf6012..56510d9ad3c 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -31,65 +31,63 @@ */ public class AdditionalPropertiesClass { - @SerializedName("map_property") +@SerializedName("map_property") private Map mapProperty = null; - @SerializedName("map_of_map_property") private Map> mapOfMapProperty = null; - + public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; return this; } public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { this.mapProperty = new HashMap(); } + this.mapProperty.put(key, mapPropertyItem); return this; } - - /** - * Get mapProperty - * @return mapProperty + /** + * Get mapProperty + * @return mapProperty **/ @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } - public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } - + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; return this; } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { this.mapOfMapProperty = new HashMap>(); } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } - - /** - * Get mapOfMapProperty - * @return mapOfMapProperty + /** + * Get mapOfMapProperty + * @return mapOfMapProperty **/ @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -107,8 +105,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapProperty, mapOfMapProperty); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -131,5 +128,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Animal.java index f65c5bffcb3..7d0184c4016 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Animal.java @@ -29,49 +29,47 @@ public class Animal { - @SerializedName("className") +@SerializedName("className") private String className = null; - @SerializedName("color") private String color = "red"; - + public Animal className(String className) { this.className = className; return this; } - /** - * Get className - * @return className + + /** + * Get className + * @return className **/ @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } - public void setClassName(String className) { this.className = className; } - + public Animal color(String color) { this.color = color; return this; } - /** - * Get color - * @return color + + /** + * Get color + * @return color **/ @ApiModelProperty(value = "") public String getColor() { return color; } - public void setColor(String color) { this.color = color; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -89,8 +87,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(className, color); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -113,5 +110,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/AnimalFarm.java deleted file mode 100644 index 0b1d6a74cc6..00000000000 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/AnimalFarm.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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 io.swagger.client.model.Animal; -import java.util.ArrayList; -import java.util.List; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index f9956fe46d8..6072a884b8b 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -31,36 +31,36 @@ */ public class ArrayOfArrayOfNumberOnly { - @SerializedName("ArrayArrayNumber") +@SerializedName("ArrayArrayNumber") private List> arrayArrayNumber = null; - + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; return this; } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { this.arrayArrayNumber = new ArrayList>(); } + this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber **/ @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } - public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -77,8 +77,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayArrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,5 +99,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index c79610d1c66..9d03a82a520 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -31,36 +31,36 @@ */ public class ArrayOfNumberOnly { - @SerializedName("ArrayNumber") +@SerializedName("ArrayNumber") private List arrayNumber = null; - + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; return this; } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { this.arrayNumber = new ArrayList(); } + this.arrayNumber.add(arrayNumberItem); return this; } - - /** - * Get arrayNumber - * @return arrayNumber + + /** + * Get arrayNumber + * @return arrayNumber **/ @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } - public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -77,8 +77,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,5 +99,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayTest.java index 747182e792e..16a6ebcc6f0 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ArrayTest.java @@ -31,94 +31,94 @@ */ public class ArrayTest { - @SerializedName("array_of_string") +@SerializedName("array_of_string") private List arrayOfString = null; - @SerializedName("array_array_of_integer") private List> arrayArrayOfInteger = null; - @SerializedName("array_array_of_model") private List> arrayArrayOfModel = null; - + public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; return this; } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { this.arrayOfString = new ArrayList(); } + this.arrayOfString.add(arrayOfStringItem); return this; } - - /** - * Get arrayOfString - * @return arrayOfString + + /** + * Get arrayOfString + * @return arrayOfString **/ @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } - public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } - + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { this.arrayArrayOfInteger = new ArrayList>(); } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger **/ @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } - + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { this.arrayArrayOfModel = new ArrayList>(); } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel **/ @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } - public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -137,8 +137,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -162,5 +161,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Capitalization.java index 00c564ab727..2c7727d7261 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Capitalization.java @@ -28,133 +28,127 @@ */ public class Capitalization { - @SerializedName("smallCamel") +@SerializedName("smallCamel") private String smallCamel = null; - @SerializedName("CapitalCamel") private String capitalCamel = null; - @SerializedName("small_Snake") private String smallSnake = null; - @SerializedName("Capital_Snake") private String capitalSnake = null; - @SerializedName("SCA_ETH_Flow_Points") private String scAETHFlowPoints = null; - @SerializedName("ATT_NAME") private String ATT_NAME = null; - + public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; return this; } - /** - * Get smallCamel - * @return smallCamel + + /** + * Get smallCamel + * @return smallCamel **/ @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } - public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } - + public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; return this; } - /** - * Get capitalCamel - * @return capitalCamel + + /** + * Get capitalCamel + * @return capitalCamel **/ @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } - public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } - + public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; return this; } - /** - * Get smallSnake - * @return smallSnake + + /** + * Get smallSnake + * @return smallSnake **/ @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } - public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } - + public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; return this; } - /** - * Get capitalSnake - * @return capitalSnake + + /** + * Get capitalSnake + * @return capitalSnake **/ @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } - public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } - + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; return this; } - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints **/ @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } - public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } - + public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; return this; } - /** - * Name of the pet - * @return ATT_NAME + + /** + * Name of the pet + * @return ATT_NAME **/ @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } - public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -176,8 +170,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -204,5 +197,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Cat.java index 64d3fbdc7fe..b093e138ba6 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Cat.java @@ -29,28 +29,67 @@ */ public class Cat extends Animal { +@SerializedName("className") + private String className = null; + @SerializedName("color") + private String color = "red"; @SerializedName("declawed") private Boolean declawed = null; + + public Cat className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Cat color(String color) { + this.color = color; + return this; + } + + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; } - /** - * Get declawed - * @return declawed + + /** + * Get declawed + * @return declawed **/ @ApiModelProperty(value = "") public Boolean isDeclawed() { return declawed; } - public void setDeclawed(Boolean declawed) { this.declawed = declawed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -60,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && + return Objects.equals(this.className, cat.className) && + Objects.equals(this.color, cat.color) && + Objects.equals(this.declawed, cat.declawed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(declawed, super.hashCode()); + return Objects.hash(className, color, declawed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); sb.append("}"); return sb.toString(); @@ -91,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Category.java index 4e9f8f56e5e..42e198faaff 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Category.java @@ -28,49 +28,47 @@ */ public class Category { - @SerializedName("id") +@SerializedName("id") private Long id = null; - @SerializedName("name") private String name = null; - + public Category id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Category name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -88,8 +86,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -112,5 +109,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ClassModel.java index 4cf0a053250..627c102a69a 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ClassModel.java @@ -25,32 +25,30 @@ /** * Model for testing model with \"_class\" property - */ -@ApiModel(description = "Model for testing model with \"_class\" property") + */@ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { - @SerializedName("_class") +@SerializedName("_class") private String propertyClass = null; - + public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,8 +65,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -90,5 +87,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Client.java index 43b20dce8da..460c9e52ba1 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Client.java @@ -28,28 +28,27 @@ */ public class Client { - @SerializedName("client") +@SerializedName("client") private String client = null; - + public Client client(String client) { this.client = client; return this; } - /** - * Get client - * @return client + + /** + * Get client + * @return client **/ @ApiModelProperty(value = "") public String getClient() { return client; } - public void setClient(String client) { this.client = client; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -66,8 +65,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(client); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -89,5 +87,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Dog.java index 8fad06d9835..4d52b28512f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Dog.java @@ -29,28 +29,67 @@ */ public class Dog extends Animal { +@SerializedName("className") + private String className = null; + @SerializedName("color") + private String color = "red"; @SerializedName("breed") private String breed = null; + + public Dog className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Dog color(String color) { + this.color = color; + return this; + } + + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Dog breed(String breed) { this.breed = breed; return this; } - /** - * Get breed - * @return breed + + /** + * Get breed + * @return breed **/ @ApiModelProperty(value = "") public String getBreed() { return breed; } - public void setBreed(String breed) { this.breed = breed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -60,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && + return Objects.equals(this.className, dog.className) && + Objects.equals(this.color, dog.color) && + Objects.equals(this.breed, dog.breed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(breed, super.hashCode()); + return Objects.hash(className, color, breed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); sb.append("}"); return sb.toString(); @@ -91,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumArrays.java index 5f063c2ec38..43000487324 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumArrays.java @@ -30,13 +30,14 @@ */ public class EnumArrays { - /** + + /** * Gets or Sets justSymbol */ @JsonAdapter(JustSymbolEnum.Adapter.class) public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), + GREATER_THAN_OR_EQUAL_TO(">="), DOLLAR("$"); private String value; @@ -44,7 +45,7 @@ public enum JustSymbolEnum { JustSymbolEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -53,7 +54,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static JustSymbolEnum fromValue(String text) { for (JustSymbolEnum b : JustSymbolEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -62,7 +63,7 @@ public static JustSymbolEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final JustSymbolEnum enumeration) throws IOException { @@ -76,17 +77,18 @@ public JustSymbolEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("just_symbol") private JustSymbolEnum justSymbol = null; - - /** + + + /** * Gets or Sets arrayEnum */ @JsonAdapter(ArrayEnumEnum.Adapter.class) public enum ArrayEnumEnum { - FISH("fish"), + FISH("fish"), CRAB("crab"); private String value; @@ -94,7 +96,7 @@ public enum ArrayEnumEnum { ArrayEnumEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -103,7 +105,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static ArrayEnumEnum fromValue(String text) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -112,7 +114,7 @@ public static ArrayEnumEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final ArrayEnumEnum enumeration) throws IOException { @@ -126,55 +128,54 @@ public ArrayEnumEnum read(final JsonReader jsonReader) throws IOException { } } } - @SerializedName("array_enum") private List arrayEnum = null; - + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; return this; } - /** - * Get justSymbol - * @return justSymbol + + /** + * Get justSymbol + * @return justSymbol **/ @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } - public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } - + public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; return this; } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { this.arrayEnum = new ArrayList(); } + this.arrayEnum.add(arrayEnumItem); return this; } - - /** - * Get arrayEnum - * @return arrayEnum + + /** + * Get arrayEnum + * @return arrayEnum **/ @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } - public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -192,8 +193,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -216,5 +216,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumClass.java index 3c19333c1ce..80a5d20a545 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumClass.java @@ -16,16 +16,21 @@ import java.util.Objects; import com.google.gson.annotations.SerializedName; + + import java.io.IOException; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; + /** * Gets or Sets EnumClass */ + @JsonAdapter(EnumClass.Adapter.class) + public enum EnumClass { _ABC("_abc"), @@ -40,6 +45,7 @@ public enum EnumClass { this.value = value; } + public String getValue() { return value; } @@ -49,6 +55,7 @@ public String toString() { return String.valueOf(value); } + public static EnumClass fromValue(String text) { for (EnumClass b : EnumClass.values()) { if (String.valueOf(b.value).equals(text)) { @@ -58,6 +65,7 @@ public static EnumClass fromValue(String text) { return null; } + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final EnumClass enumeration) throws IOException { @@ -70,5 +78,8 @@ public EnumClass read(final JsonReader jsonReader) throws IOException { return EnumClass.fromValue(String.valueOf(value)); } } + } + + 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 fb20599a85c..4ca2772ab1b 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 @@ -29,15 +29,15 @@ */ public class EnumTest { - /** + + /** * Gets or Sets enumString */ @JsonAdapter(EnumStringEnum.Adapter.class) public enum EnumStringEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"), - EMPTY(""); private String value; @@ -45,7 +45,7 @@ public enum EnumStringEnum { EnumStringEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -54,7 +54,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static EnumStringEnum fromValue(String text) { for (EnumStringEnum b : EnumStringEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -63,7 +63,7 @@ public static EnumStringEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final EnumStringEnum enumeration) throws IOException { @@ -77,17 +77,17 @@ public EnumStringEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("enum_string") private EnumStringEnum enumString = null; - - /** + + /** * Gets or Sets enumInteger */ @JsonAdapter(EnumIntegerEnum.Adapter.class) public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(1), NUMBER_MINUS_1(-1); private Integer value; @@ -95,7 +95,7 @@ public enum EnumIntegerEnum { EnumIntegerEnum(Integer value) { this.value = value; } - + public Integer getValue() { return value; } @@ -104,7 +104,7 @@ public Integer getValue() { public String toString() { return String.valueOf(value); } - + public static EnumIntegerEnum fromValue(String text) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -113,7 +113,7 @@ public static EnumIntegerEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final EnumIntegerEnum enumeration) throws IOException { @@ -127,17 +127,17 @@ public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("enum_integer") private EnumIntegerEnum enumInteger = null; - - /** + + /** * Gets or Sets enumNumber */ @JsonAdapter(EnumNumberEnum.Adapter.class) public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(1.1), NUMBER_MINUS_1_DOT_2(-1.2); private Double value; @@ -145,7 +145,7 @@ public enum EnumNumberEnum { EnumNumberEnum(Double value) { this.value = value; } - + public Double getValue() { return value; } @@ -154,7 +154,7 @@ public Double getValue() { public String toString() { return String.valueOf(value); } - + public static EnumNumberEnum fromValue(String text) { for (EnumNumberEnum b : EnumNumberEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -163,7 +163,7 @@ public static EnumNumberEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final EnumNumberEnum enumeration) throws IOException { @@ -177,86 +177,84 @@ public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("enum_number") private EnumNumberEnum enumNumber = null; - @SerializedName("outerEnum") private OuterEnum outerEnum = null; - + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; } - /** - * Get enumString - * @return enumString + + /** + * Get enumString + * @return enumString **/ @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } - public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } - + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; } - /** - * Get enumInteger - * @return enumInteger + + /** + * Get enumInteger + * @return enumInteger **/ @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } - public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } - + public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; return this; } - /** - * Get enumNumber - * @return enumNumber + + /** + * Get enumNumber + * @return enumNumber **/ @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } - public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - + public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; return this; } - /** - * Get outerEnum - * @return outerEnum + + /** + * Get outerEnum + * @return outerEnum **/ @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -276,8 +274,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -302,5 +299,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\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 ddb80771fda..9979fcd8cc3 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 @@ -32,290 +32,271 @@ */ public class FormatTest { - @SerializedName("integer") +@SerializedName("integer") private Integer integer = null; - @SerializedName("int32") private Integer int32 = null; - @SerializedName("int64") private Long int64 = null; - @SerializedName("number") private BigDecimal number = null; - @SerializedName("float") private Float _float = null; - @SerializedName("double") private Double _double = null; - @SerializedName("string") private String string = null; - @SerializedName("byte") - private byte[] _byte = null; - + private String _byte = null; @SerializedName("binary") - private byte[] binary = null; - + private String binary = null; @SerializedName("date") private LocalDate date = null; - @SerializedName("dateTime") private OffsetDateTime dateTime = null; - @SerializedName("uuid") private UUID uuid = null; - @SerializedName("password") private String password = null; - + public FormatTest integer(Integer integer) { this.integer = integer; return this; } - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer **/ @ApiModelProperty(value = "") public Integer getInteger() { return integer; } - public void setInteger(Integer integer) { this.integer = integer; } - + public FormatTest int32(Integer int32) { this.int32 = int32; return this; } - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 **/ @ApiModelProperty(value = "") public Integer getInt32() { return int32; } - public void setInt32(Integer int32) { this.int32 = int32; } - + public FormatTest int64(Long int64) { this.int64 = int64; return this; } - /** - * Get int64 - * @return int64 + + /** + * Get int64 + * @return int64 **/ @ApiModelProperty(value = "") public Long getInt64() { return int64; } - public void setInt64(Long int64) { this.int64 = int64; } - + public FormatTest number(BigDecimal number) { this.number = number; return this; } - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number + + /** + * Get number + * @return number **/ @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } - public void setNumber(BigDecimal number) { this.number = number; } - + public FormatTest _float(Float _float) { this._float = _float; return this; } - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float + + /** + * Get _float + * @return _float **/ @ApiModelProperty(value = "") public Float getFloat() { return _float; } - public void setFloat(Float _float) { this._float = _float; } - + public FormatTest _double(Double _double) { this._double = _double; return this; } - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double + + /** + * Get _double + * @return _double **/ @ApiModelProperty(value = "") public Double getDouble() { return _double; } - public void setDouble(Double _double) { this._double = _double; } - + public FormatTest string(String string) { this.string = string; return this; } - /** - * Get string - * @return string + + /** + * Get string + * @return string **/ @ApiModelProperty(value = "") public String getString() { return string; } - public void setString(String string) { this.string = string; } - - public FormatTest _byte(byte[] _byte) { + + public FormatTest _byte(String _byte) { this._byte = _byte; return this; } - /** - * Get _byte - * @return _byte + + /** + * Get _byte + * @return _byte **/ @ApiModelProperty(required = true, value = "") - public byte[] getByte() { + public String getByte() { return _byte; } - - public void setByte(byte[] _byte) { + public void setByte(String _byte) { this._byte = _byte; } - - public FormatTest binary(byte[] binary) { + + public FormatTest binary(String binary) { this.binary = binary; return this; } - /** - * Get binary - * @return binary + + /** + * Get binary + * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public String getBinary() { return binary; } - - public void setBinary(byte[] binary) { + public void setBinary(String binary) { this.binary = binary; } - + public FormatTest date(LocalDate date) { this.date = date; return this; } - /** - * Get date - * @return date + + /** + * Get date + * @return date **/ @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } - public void setDate(LocalDate date) { this.date = date; } - + public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public FormatTest password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -344,8 +325,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -379,5 +359,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 1b7ff181941..ddb6837fecb 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -28,31 +28,31 @@ */ public class HasOnlyReadOnly { - @SerializedName("bar") +@SerializedName("bar") private String bar = null; - @SerializedName("foo") private String foo = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - - /** - * Get foo - * @return foo + + + /** + * Get foo + * @return foo **/ @ApiModelProperty(value = "") public String getFoo() { return foo; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -70,8 +70,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, foo); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -94,5 +93,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MapTest.java index a791e68d8fb..29e18228896 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MapTest.java @@ -31,16 +31,17 @@ */ public class MapTest { - @SerializedName("map_map_of_string") +@SerializedName("map_map_of_string") private Map> mapMapOfString = null; - - /** + + + /** * Gets or Sets inner */ @JsonAdapter(InnerEnum.Adapter.class) public enum InnerEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"); private String value; @@ -48,7 +49,7 @@ public enum InnerEnum { InnerEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -57,7 +58,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static InnerEnum fromValue(String text) { for (InnerEnum b : InnerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -66,7 +67,7 @@ public static InnerEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final InnerEnum enumeration) throws IOException { @@ -80,63 +81,61 @@ public InnerEnum read(final JsonReader jsonReader) throws IOException { } } } - @SerializedName("map_of_enum_string") private Map mapOfEnumString = null; - + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; } public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { this.mapMapOfString = new HashMap>(); } + this.mapMapOfString.put(key, mapMapOfStringItem); return this; } - - /** - * Get mapMapOfString - * @return mapMapOfString + /** + * Get mapMapOfString + * @return mapMapOfString **/ @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } - public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } - + public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; return this; } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { this.mapOfEnumString = new HashMap(); } + this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } - - /** - * Get mapOfEnumString - * @return mapOfEnumString + /** + * Get mapOfEnumString + * @return mapOfEnumString **/ @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } - public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -154,8 +153,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -178,5 +176,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 7c99abe53eb..9efda42416f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -34,78 +34,75 @@ */ public class MixedPropertiesAndAdditionalPropertiesClass { - @SerializedName("uuid") +@SerializedName("uuid") private UUID uuid = null; - @SerializedName("dateTime") private OffsetDateTime dateTime = null; - @SerializedName("map") private Map map = null; - + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; return this; } public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { this.map = new HashMap(); } + this.map.put(key, mapItem); return this; } - - /** - * Get map - * @return map + /** + * Get map + * @return map **/ @ApiModelProperty(value = "") public Map getMap() { return map; } - public void setMap(Map map) { this.map = map; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -124,8 +121,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(uuid, dateTime, map); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -149,5 +145,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 0d39eb7eff5..66416f6c0cb 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 @@ -25,53 +25,50 @@ /** * Model for testing model name starting with number - */ -@ApiModel(description = "Model for testing model name starting with number") + */@ApiModel(description = "Model for testing model name starting with number") public class Model200Response { - @SerializedName("name") +@SerializedName("name") private Integer name = null; - @SerializedName("class") private String propertyClass = null; - + public Model200Response name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - + public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -89,8 +86,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -113,5 +109,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelApiResponse.java index 3d9352c50aa..5217ac1d2ea 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -28,70 +28,67 @@ */ public class ModelApiResponse { - @SerializedName("code") +@SerializedName("code") private Integer code = null; - @SerializedName("type") private String type = null; - @SerializedName("message") private String message = null; - + public ModelApiResponse code(Integer code) { this.code = code; return this; } - /** - * Get code - * @return code + + /** + * Get code + * @return code **/ @ApiModelProperty(value = "") public Integer getCode() { return code; } - public void setCode(Integer code) { this.code = code; } - + public ModelApiResponse type(String type) { this.type = type; return this; } - /** - * Get type - * @return type + + /** + * Get type + * @return type **/ @ApiModelProperty(value = "") public String getType() { return type; } - public void setType(String type) { this.type = type; } - + public ModelApiResponse message(String message) { this.message = message; return this; } - /** - * Get message - * @return message + + /** + * Get message + * @return message **/ @ApiModelProperty(value = "") public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -110,8 +107,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(code, type, message); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -135,5 +131,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelReturn.java index ab6333ff86d..21d717b8076 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelReturn.java @@ -25,32 +25,30 @@ /** * Model for testing reserved words - */ -@ApiModel(description = "Model for testing reserved words") + */@ApiModel(description = "Model for testing reserved words") public class ModelReturn { - @SerializedName("return") +@SerializedName("return") private Integer _return = null; - + public ModelReturn _return(Integer _return) { this._return = _return; return this; } - /** - * Get _return - * @return _return + + /** + * Get _return + * @return _return **/ @ApiModelProperty(value = "") public Integer getReturn() { return _return; } - public void setReturn(Integer _return) { this._return = _return; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,8 +65,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(_return); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -90,5 +87,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 1492add2952..c631e933a60 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 @@ -25,77 +25,74 @@ /** * Model for testing model name same as property name - */ -@ApiModel(description = "Model for testing model name same as property name") + */@ApiModel(description = "Model for testing model name same as property name") public class Name { - @SerializedName("name") +@SerializedName("name") private Integer name = null; - @SerializedName("snake_case") private Integer snakeCase = null; - @SerializedName("property") private String property = null; - @SerializedName("123Number") private Integer _123Number = null; - + public Name name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - - /** - * Get snakeCase - * @return snakeCase + + + /** + * Get snakeCase + * @return snakeCase **/ @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } - + public Name property(String property) { this.property = property; return this; } - /** - * Get property - * @return property + + /** + * Get property + * @return property **/ @ApiModelProperty(value = "") public String getProperty() { return property; } - public void setProperty(String property) { this.property = property; } - - /** - * Get _123Number - * @return _123Number + + + /** + * Get _123Number + * @return _123Number **/ @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -115,8 +112,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, snakeCase, property, _123Number); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -141,5 +137,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/NumberOnly.java index b13c0536a13..0468fa26f78 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/NumberOnly.java @@ -29,28 +29,27 @@ */ public class NumberOnly { - @SerializedName("JustNumber") +@SerializedName("JustNumber") private BigDecimal justNumber = null; - + public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; return this; } - /** - * Get justNumber - * @return justNumber + + /** + * Get justNumber + * @return justNumber **/ @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } - public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,8 +66,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -90,5 +88,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Order.java index 4dcf75a7cd0..6192a446f0a 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Order.java @@ -29,27 +29,23 @@ */ public class Order { - @SerializedName("id") +@SerializedName("id") private Long id = null; - @SerializedName("petId") private Long petId = null; - @SerializedName("quantity") private Integer quantity = null; - @SerializedName("shipDate") private OffsetDateTime shipDate = null; - - /** + + /** * Order Status */ @JsonAdapter(StatusEnum.Adapter.class) public enum StatusEnum { - PLACED("placed"), + PLACED("placed"), APPROVED("approved"), - DELIVERED("delivered"); private String value; @@ -57,7 +53,7 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -66,7 +62,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -75,7 +71,7 @@ public static StatusEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { @@ -89,122 +85,120 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("status") private StatusEnum status = null; - @SerializedName("complete") private Boolean complete = false; - + public Order id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Order petId(Long petId) { this.petId = petId; return this; } - /** - * Get petId - * @return petId + + /** + * Get petId + * @return petId **/ @ApiModelProperty(value = "") public Long getPetId() { return petId; } - public void setPetId(Long petId) { this.petId = petId; } - + public Order quantity(Integer quantity) { this.quantity = quantity; return this; } - /** - * Get quantity - * @return quantity + + /** + * Get quantity + * @return quantity **/ @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } - public void setQuantity(Integer quantity) { this.quantity = quantity; } - + public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; return this; } - /** - * Get shipDate - * @return shipDate + + /** + * Get shipDate + * @return shipDate **/ @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } - public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } - + public Order status(StatusEnum status) { this.status = status; return this; } - /** - * Order Status - * @return status + + /** + * Order Status + * @return status **/ @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - + public Order complete(Boolean complete) { this.complete = complete; return this; } - /** - * Get complete - * @return complete + + /** + * Get complete + * @return complete **/ @ApiModelProperty(value = "") public Boolean isComplete() { return complete; } - public void setComplete(Boolean complete) { this.complete = complete; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -226,8 +220,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -254,5 +247,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterComposite.java index 56159fe5d93..039a870d41b 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterComposite.java @@ -29,70 +29,67 @@ */ public class OuterComposite { - @SerializedName("my_number") +@SerializedName("my_number") private BigDecimal myNumber = null; - @SerializedName("my_string") private String myString = null; - @SerializedName("my_boolean") private Boolean myBoolean = null; - + public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; return this; } - /** - * Get myNumber - * @return myNumber + + /** + * Get myNumber + * @return myNumber **/ @ApiModelProperty(value = "") public BigDecimal getMyNumber() { return myNumber; } - public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } - + public OuterComposite myString(String myString) { this.myString = myString; return this; } - /** - * Get myString - * @return myString + + /** + * Get myString + * @return myString **/ @ApiModelProperty(value = "") public String getMyString() { return myString; } - public void setMyString(String myString) { this.myString = myString; } - + public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; return this; } - /** - * Get myBoolean - * @return myBoolean + + /** + * Get myBoolean + * @return myBoolean **/ @ApiModelProperty(value = "") public Boolean getMyBoolean() { return myBoolean; } - public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -111,8 +108,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(myNumber, myString, myBoolean); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -136,5 +132,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterEnum.java index 3b24acc6b51..2bb0d8fcb27 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/OuterEnum.java @@ -16,16 +16,21 @@ import java.util.Objects; import com.google.gson.annotations.SerializedName; + + import java.io.IOException; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; + /** * Gets or Sets OuterEnum */ + @JsonAdapter(OuterEnum.Adapter.class) + public enum OuterEnum { PLACED("placed"), @@ -40,6 +45,7 @@ public enum OuterEnum { this.value = value; } + public String getValue() { return value; } @@ -49,6 +55,7 @@ public String toString() { return String.valueOf(value); } + public static OuterEnum fromValue(String text) { for (OuterEnum b : OuterEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -58,6 +65,7 @@ public static OuterEnum fromValue(String text) { return null; } + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final OuterEnum enumeration) throws IOException { @@ -70,5 +78,8 @@ public OuterEnum read(final JsonReader jsonReader) throws IOException { return OuterEnum.fromValue(String.valueOf(value)); } } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Pet.java index dac1250ac07..2b91dae9614 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Pet.java @@ -32,30 +32,25 @@ */ public class Pet { - @SerializedName("id") +@SerializedName("id") private Long id = null; - @SerializedName("category") private Category category = null; - @SerializedName("name") private String name = null; - @SerializedName("photoUrls") private List photoUrls = new ArrayList(); - @SerializedName("tags") private List tags = null; - - /** + + /** * pet status in the store */ @JsonAdapter(StatusEnum.Adapter.class) public enum StatusEnum { - AVAILABLE("available"), + AVAILABLE("available"), PENDING("pending"), - SOLD("sold"); private String value; @@ -63,7 +58,7 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -72,7 +67,7 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -81,7 +76,7 @@ public static StatusEnum fromValue(String text) { } return null; } - + public static class Adapter extends TypeAdapter { @Override public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { @@ -95,132 +90,132 @@ public StatusEnum read(final JsonReader jsonReader) throws IOException { } } } - + @SerializedName("status") private StatusEnum status = null; - + public Pet id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Pet category(Category category) { this.category = category; return this; } - /** - * Get category - * @return category + + /** + * Get category + * @return category **/ @ApiModelProperty(value = "") public Category getCategory() { return category; } - public void setCategory(Category category) { this.category = category; } - + public Pet name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - + public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); return this; } - - /** - * Get photoUrls - * @return photoUrls + + /** + * Get photoUrls + * @return photoUrls **/ @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } - + public Pet tags(List tags) { this.tags = tags; return this; } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { this.tags = new ArrayList(); } + this.tags.add(tagsItem); return this; } - - /** - * Get tags - * @return tags + + /** + * Get tags + * @return tags **/ @ApiModelProperty(value = "") public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } - + public Pet status(StatusEnum status) { this.status = status; return this; } - /** - * pet status in the store - * @return status + + /** + * pet status in the store + * @return status **/ @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -242,8 +237,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -270,5 +264,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index f6e025412de..c7c8eb90968 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -28,40 +28,39 @@ */ public class ReadOnlyFirst { - @SerializedName("bar") +@SerializedName("bar") private String bar = null; - @SerializedName("baz") private String baz = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; } - /** - * Get baz - * @return baz + + /** + * Get baz + * @return baz **/ @ApiModelProperty(value = "") public String getBaz() { return baz; } - public void setBaz(String baz) { this.baz = baz; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -79,8 +78,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, baz); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -103,5 +101,8 @@ private String toIndentedString(java.lang.Object o) { 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 e743292100b..3e2312615c2 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 @@ -28,28 +28,27 @@ */ public class SpecialModelName { - @SerializedName("$special[property.name]") - private Long specialPropertyName = null; - - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; +@SerializedName("$special[property.name]") + private Long $specialPropertyName = null; + + 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; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -58,22 +57,21 @@ public boolean equals(java.lang.Object o) { 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); } - - + @Override public String toString() { 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(); } @@ -89,5 +87,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Tag.java index bb6de58c8a1..b032d15676a 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Tag.java @@ -28,49 +28,47 @@ */ public class Tag { - @SerializedName("id") +@SerializedName("id") private Long id = null; - @SerializedName("name") private String name = null; - + public Tag id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Tag name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -88,8 +86,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -112,5 +109,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/User.java index 4ccb8a1c147..75e44e2ff37 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/User.java @@ -28,175 +28,167 @@ */ public class User { - @SerializedName("id") +@SerializedName("id") private Long id = null; - @SerializedName("username") private String username = null; - @SerializedName("firstName") private String firstName = null; - @SerializedName("lastName") private String lastName = null; - @SerializedName("email") private String email = null; - @SerializedName("password") private String password = null; - @SerializedName("phone") private String phone = null; - @SerializedName("userStatus") private Integer userStatus = null; - + public User id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public User username(String username) { this.username = username; return this; } - /** - * Get username - * @return username + + /** + * Get username + * @return username **/ @ApiModelProperty(value = "") public String getUsername() { return username; } - public void setUsername(String username) { this.username = username; } - + public User firstName(String firstName) { this.firstName = firstName; return this; } - /** - * Get firstName - * @return firstName + + /** + * Get firstName + * @return firstName **/ @ApiModelProperty(value = "") public String getFirstName() { return firstName; } - public void setFirstName(String firstName) { this.firstName = firstName; } - + public User lastName(String lastName) { this.lastName = lastName; return this; } - /** - * Get lastName - * @return lastName + + /** + * Get lastName + * @return lastName **/ @ApiModelProperty(value = "") public String getLastName() { return lastName; } - public void setLastName(String lastName) { this.lastName = lastName; } - + public User email(String email) { this.email = email; return this; } - /** - * Get email - * @return email + + /** + * Get email + * @return email **/ @ApiModelProperty(value = "") public String getEmail() { return email; } - public void setEmail(String email) { this.email = email; } - + public User password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - + public User phone(String phone) { this.phone = phone; return this; } - /** - * Get phone - * @return phone + + /** + * Get phone + * @return phone **/ @ApiModelProperty(value = "") public String getPhone() { return phone; } - public void setPhone(String phone) { this.phone = phone; } - + public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; } - /** - * User Status - * @return userStatus + + /** + * User Status + * @return userStatus **/ @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } - public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -220,8 +212,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -250,5 +241,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..6fdc3702e80 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 @@ -2,14 +2,17 @@ import io.swagger.client.ApiClient; import io.swagger.client.model.Client; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for AnotherFakeApi */ @@ -22,6 +25,8 @@ public void setup() { api = new ApiClient().createService(AnotherFakeApi.class); } + + /** * To test special tags * @@ -29,9 +34,13 @@ public void setup() { */ @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..559492405ac 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,17 +3,18 @@ import io.swagger.client.ApiClient; 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 org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for FakeApi */ @@ -26,6 +27,8 @@ public void setup() { api = new ApiClient().createService(FakeApi.class); } + + /** * * @@ -33,11 +36,14 @@ public void setup() { */ @Test public void fakeOuterBooleanSerializeTest() { + Boolean body = null; + // Boolean response = api.fakeOuterBooleanSerialize(body); // TODO: test validations } + /** * * @@ -45,11 +51,14 @@ public void fakeOuterBooleanSerializeTest() { */ @Test public void fakeOuterCompositeSerializeTest() { - OuterComposite body = null; - // OuterComposite response = api.fakeOuterCompositeSerialize(body); + + OuterComposite outercomposite = null; + + // OuterComposite response = api.fakeOuterCompositeSerialize(outercomposite); // TODO: test validations } + /** * * @@ -57,11 +66,14 @@ public void fakeOuterCompositeSerializeTest() { */ @Test public void fakeOuterNumberSerializeTest() { + BigDecimal body = null; + // BigDecimal response = api.fakeOuterNumberSerialize(body); // TODO: test validations } + /** * * @@ -69,11 +81,14 @@ public void fakeOuterNumberSerializeTest() { */ @Test public void fakeOuterStringSerializeTest() { + String body = null; + // String response = api.fakeOuterStringSerialize(body); // TODO: test validations } + /** * To test \"client\" model * @@ -81,11 +96,14 @@ public void fakeOuterStringSerializeTest() { */ @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 假端點 偽のエンドポイント 가짜 엔드 포인트 * @@ -93,24 +111,14 @@ public void testClientModelTest() { */ @Test public void testEndpointParametersTest() { - BigDecimal number = null; - Double _double = null; - String patternWithoutDelimiter = null; - byte[] _byte = null; - Integer integer = null; - Integer int32 = null; - Long int64 = null; - Float _float = null; - String string = null; - byte[] 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); + + Object body = null; + + // Void response = api.testEndpointParameters(body); // TODO: test validations } + /** * To test enum parameters * @@ -118,18 +126,39 @@ public void testEndpointParametersTest() { */ @Test public void testEnumParametersTest() { - List enumFormStringArray = null; - String enumFormString = null; + + Object body = 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); + + // Void response = api.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); + + // TODO: test validations + } + + /** + * test inline additionalProperties + * + * + */ + @Test + public void testInlineAdditionalPropertiesTest() { + + Map body = null; + + // Void response = api.testInlineAdditionalProperties(body); // TODO: test validations } + /** * test json serialization of form data * @@ -137,10 +166,13 @@ public void testEnumParametersTest() { */ @Test public void testJsonFormDataTest() { - String param = null; - String param2 = null; - // Void response = api.testJsonFormData(param, param2); + + Object body = null; + + // Void response = api.testJsonFormData(body); // 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..ab29f7ce6af 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 @@ -2,14 +2,17 @@ import io.swagger.client.ApiClient; import io.swagger.client.model.Client; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for FakeClassnameTags123Api */ @@ -23,6 +26,7 @@ public void setup() { } + /** * To test class name in snake case * @@ -30,10 +34,13 @@ public void setup() { */ @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..7b467b0b508 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 @@ -1,17 +1,19 @@ package io.swagger.client.api; import io.swagger.client.ApiClient; -import java.io.File; 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.HashMap; import java.util.List; import java.util.Map; + /** * API tests for PetApi */ @@ -25,6 +27,7 @@ public void setup() { } + /** * Add a new pet to the store * @@ -32,8 +35,10 @@ public void setup() { */ @Test public void addPetTest() { - Pet body = null; - // Void response = api.addPet(body); + + Pet pet = null; + + // Void response = api.addPet(pet); // TODO: test validations } @@ -45,8 +50,11 @@ public void addPetTest() { */ @Test public void deletePetTest() { - Long petId = null; + + Integer petId = null; + String apiKey = null; + // Void response = api.deletePet(petId, apiKey); // TODO: test validations @@ -59,7 +67,9 @@ public void deletePetTest() { */ @Test public void findPetsByStatusTest() { + List status = null; + // List response = api.findPetsByStatus(status); // TODO: test validations @@ -72,7 +82,9 @@ public void findPetsByStatusTest() { */ @Test public void findPetsByTagsTest() { + List tags = null; + // List response = api.findPetsByTags(tags); // TODO: test validations @@ -85,7 +97,9 @@ public void findPetsByTagsTest() { */ @Test public void getPetByIdTest() { - Long petId = null; + + Integer petId = null; + // Pet response = api.getPetById(petId); // TODO: test validations @@ -98,8 +112,10 @@ public void getPetByIdTest() { */ @Test public void updatePetTest() { - Pet body = null; - // Void response = api.updatePet(body); + + Pet pet = null; + + // Void response = api.updatePet(pet); // TODO: test validations } @@ -111,10 +127,12 @@ public void updatePetTest() { */ @Test public void updatePetWithFormTest() { - Long petId = null; - String name = null; - String status = null; - // Void response = api.updatePetWithForm(petId, name, status); + + Integer petId = null; + + Object body = null; + + // Void response = api.updatePetWithForm(petId, body); // TODO: test validations } @@ -126,12 +144,15 @@ public void updatePetWithFormTest() { */ @Test public void uploadFileTest() { - Long petId = null; - String additionalMetadata = null; - File file = null; - // ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); + + Integer petId = null; + + Object body = null; + + // ModelApiResponse response = api.uploadFile(petId, body); // 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..f59141e4eed 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 @@ -2,14 +2,17 @@ import io.swagger.client.ApiClient; import io.swagger.client.model.Order; + import org.junit.Before; import org.junit.Test; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + /** * API tests for StoreApi */ @@ -23,6 +26,7 @@ public void setup() { } + /** * Delete purchase order by ID * @@ -30,7 +34,9 @@ public void setup() { */ @Test public void deleteOrderTest() { + String orderId = null; + // Void response = api.deleteOrder(orderId); // TODO: test validations @@ -43,6 +49,7 @@ public void deleteOrderTest() { */ @Test public void getInventoryTest() { + // Map response = api.getInventory(); // TODO: test validations @@ -55,7 +62,9 @@ public void getInventoryTest() { */ @Test public void getOrderByIdTest() { - Long orderId = null; + + Integer orderId = null; + // Order response = api.getOrderById(orderId); // TODO: test validations @@ -68,10 +77,13 @@ public void getOrderByIdTest() { */ @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..2f011d503a5 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 @@ -2,14 +2,17 @@ import io.swagger.client.ApiClient; 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; + /** * API tests for UserApi */ @@ -23,6 +26,7 @@ public void setup() { } + /** * Create user * @@ -30,8 +34,10 @@ public void setup() { */ @Test public void createUserTest() { - User body = null; - // Void response = api.createUser(body); + + User user = null; + + // Void response = api.createUser(user); // TODO: test validations } @@ -43,7 +49,9 @@ public void createUserTest() { */ @Test public void createUsersWithArrayInputTest() { + List body = null; + // Void response = api.createUsersWithArrayInput(body); // TODO: test validations @@ -56,7 +64,9 @@ public void createUsersWithArrayInputTest() { */ @Test public void createUsersWithListInputTest() { + List body = null; + // Void response = api.createUsersWithListInput(body); // TODO: test validations @@ -69,7 +79,9 @@ public void createUsersWithListInputTest() { */ @Test public void deleteUserTest() { + String username = null; + // Void response = api.deleteUser(username); // TODO: test validations @@ -82,7 +94,9 @@ public void deleteUserTest() { */ @Test public void getUserByNameTest() { + String username = null; + // User response = api.getUserByName(username); // TODO: test validations @@ -95,8 +109,11 @@ public void getUserByNameTest() { */ @Test public void loginUserTest() { + String username = null; + String password = null; + // String response = api.loginUser(username, password); // TODO: test validations @@ -109,6 +126,7 @@ public void loginUserTest() { */ @Test public void logoutUserTest() { + // Void response = api.logoutUser(); // TODO: test validations @@ -121,11 +139,15 @@ public void logoutUserTest() { */ @Test public void updateUserTest() { + + User user = null; + String username = null; - User body = null; - // Void response = api.updateUser(username, body); + + // Void response = api.updateUser(user, username); // TODO: test validations } + } diff --git a/samples/client/petstore/java/vertx/.swagger-codegen/VERSION b/samples/client/petstore/java/vertx/.swagger-codegen/VERSION index f9f7450d135..096bf47efe3 100644 --- a/samples/client/petstore/java/vertx/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/vertx/.swagger-codegen/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..d12984e50ae 100644 --- a/samples/client/petstore/java/vertx/README.md +++ b/samples/client/petstore/java/vertx/README.md @@ -61,22 +61,27 @@ 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) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + + + AnotherFakeApi apiInstance = new AnotherFakeApi(); + + Client client = ; // Client | client model - FakeApi apiInstance = new FakeApi(); - Boolean body = true; // Boolean | Input boolean as post body 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,6 +95,7 @@ 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 | @@ -97,6 +103,7 @@ Class | Method | HTTP request | Description *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 @@ -125,14 +132,15 @@ Class | Method | HTTP request | Description - [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) @@ -153,8 +161,6 @@ Class | Method | HTTP request | Description - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) - - [Cat](docs/Cat.md) - - [Dog](docs/Dog.md) ## Documentation for Authorization @@ -166,24 +172,37 @@ 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 - **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 diff --git a/samples/client/petstore/java/vertx/build.gradle b/samples/client/petstore/java/vertx/build.gradle index cf2ca3f977c..03eee91db67 100644 --- a/samples/client/petstore/java/vertx/build.gradle +++ b/samples/client/petstore/java/vertx/build.gradle @@ -39,8 +39,13 @@ dependencies { compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" + + compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" + + compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_version" + testCompile "junit:junit:$junit_version" testCompile "io.vertx:vertx-unit:$vertx_version" } diff --git a/samples/client/petstore/java/vertx/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/vertx/docs/AdditionalPropertiesClass.md index 0437c4dd8cc..b37862da7cf 100644 --- a/samples/client/petstore/java/vertx/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/java/vertx/docs/AdditionalPropertiesClass.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/vertx/docs/Animal.md b/samples/client/petstore/java/vertx/docs/Animal.md index b3f325c3524..346caaf63f4 100644 --- a/samples/client/petstore/java/vertx/docs/Animal.md +++ b/samples/client/petstore/java/vertx/docs/Animal.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/vertx/docs/AnimalFarm.md b/samples/client/petstore/java/vertx/docs/AnimalFarm.md deleted file mode 100644 index c7c7f1ddcce..00000000000 --- a/samples/client/petstore/java/vertx/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ - -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - 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..fb5c988e6cc --- /dev/null +++ b/samples/client/petstore/java/vertx/docs/AnotherFakeApi.md @@ -0,0 +1,62 @@ +# 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 = ; // 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**](.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/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/vertx/docs/ArrayOfArrayOfNumberOnly.md index 77292549927..3671a5e9190 100644 --- a/samples/client/petstore/java/vertx/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/java/vertx/docs/ArrayOfArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/vertx/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/vertx/docs/ArrayOfNumberOnly.md index e8cc4cd36dc..30b9b6648f4 100644 --- a/samples/client/petstore/java/vertx/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/java/vertx/docs/ArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/vertx/docs/ArrayTest.md b/samples/client/petstore/java/vertx/docs/ArrayTest.md index 9feee16427f..4ab76343030 100644 --- a/samples/client/petstore/java/vertx/docs/ArrayTest.md +++ b/samples/client/petstore/java/vertx/docs/ArrayTest.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/vertx/docs/Capitalization.md b/samples/client/petstore/java/vertx/docs/Capitalization.md index 0f3064c1996..9af7864f97e 100644 --- a/samples/client/petstore/java/vertx/docs/Capitalization.md +++ b/samples/client/petstore/java/vertx/docs/Capitalization.md @@ -13,3 +13,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/vertx/docs/Cat.md b/samples/client/petstore/java/vertx/docs/Cat.md index 6e9f71ce7dd..5e408344021 100644 --- a/samples/client/petstore/java/vertx/docs/Cat.md +++ b/samples/client/petstore/java/vertx/docs/Cat.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **declawed** | **Boolean** | | [optional] + diff --git a/samples/client/petstore/java/vertx/docs/Category.md b/samples/client/petstore/java/vertx/docs/Category.md index e2df0803278..deb5a3e2a52 100644 --- a/samples/client/petstore/java/vertx/docs/Category.md +++ b/samples/client/petstore/java/vertx/docs/Category.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/vertx/docs/ClassModel.md b/samples/client/petstore/java/vertx/docs/ClassModel.md index 64f880c8786..49c281cc0ed 100644 --- a/samples/client/petstore/java/vertx/docs/ClassModel.md +++ b/samples/client/petstore/java/vertx/docs/ClassModel.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/vertx/docs/Client.md b/samples/client/petstore/java/vertx/docs/Client.md index 5c490ea166c..52b2f72c79c 100644 --- a/samples/client/petstore/java/vertx/docs/Client.md +++ b/samples/client/petstore/java/vertx/docs/Client.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/vertx/docs/Dog.md b/samples/client/petstore/java/vertx/docs/Dog.md index ac7cea323ff..00e6446e9f5 100644 --- a/samples/client/petstore/java/vertx/docs/Dog.md +++ b/samples/client/petstore/java/vertx/docs/Dog.md @@ -4,7 +4,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**className** | **String** | | +**color** | **String** | | [optional] **breed** | **String** | | [optional] + diff --git a/samples/client/petstore/java/vertx/docs/EnumArrays.md b/samples/client/petstore/java/vertx/docs/EnumArrays.md index 4dddc0bfd27..939a0e69587 100644 --- a/samples/client/petstore/java/vertx/docs/EnumArrays.md +++ b/samples/client/petstore/java/vertx/docs/EnumArrays.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] + ## Enum: JustSymbolEnum Name | Value @@ -20,8 +21,6 @@ DOLLAR | "$" ## Enum: List<ArrayEnumEnum> Name | Value ---- | ----- -FISH | "fish" -CRAB | "crab" diff --git a/samples/client/petstore/java/vertx/docs/EnumTest.md b/samples/client/petstore/java/vertx/docs/EnumTest.md index 08fee344882..9722c621962 100644 --- a/samples/client/petstore/java/vertx/docs/EnumTest.md +++ b/samples/client/petstore/java/vertx/docs/EnumTest.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] + ## Enum: EnumStringEnum Name | Value diff --git a/samples/client/petstore/java/vertx/docs/FakeApi.md b/samples/client/petstore/java/vertx/docs/FakeApi.md index 0418b476a66..6690b870e4e 100644 --- a/samples/client/petstore/java/vertx/docs/FakeApi.md +++ b/samples/client/petstore/java/vertx/docs/FakeApi.md @@ -11,9 +11,12 @@ Method | HTTP request | Description [**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) @@ -29,8 +32,11 @@ Test serialization of outer boolean types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body + +Boolean body = ; // Boolean | Input boolean as post body + try { Boolean result = apiInstance.fakeOuterBooleanSerialize(body); System.out.println(result); @@ -46,6 +52,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] + ### Return type **Boolean** @@ -56,12 +63,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) +> OuterComposite fakeOuterCompositeSerialize(outercomposite) @@ -74,10 +82,13 @@ Test serialization of object with outer number type //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body + +OuterComposite 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 +100,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] + **outercomposite** | [**OuterComposite**](.md)| Input composite as post body | [optional] + ### Return type @@ -101,8 +113,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterNumberSerialize** @@ -119,8 +132,11 @@ Test serialization of outer number types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body + +BigDecimal body = ; // BigDecimal | Input number as post body + try { BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); System.out.println(result); @@ -136,6 +152,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] + ### Return type [**BigDecimal**](BigDecimal.md) @@ -146,8 +163,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **fakeOuterStringSerialize** @@ -164,8 +182,11 @@ Test serialization of outer string types //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String body = "body_example"; // String | Input string as post body + +String body = ; // String | Input string as post body + try { String result = apiInstance.fakeOuterStringSerialize(body); System.out.println(result); @@ -181,6 +202,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**String**](String.md)| Input string as post body | [optional] + ### Return type **String** @@ -191,12 +213,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined + - **Content-Type**: */* + - **Accept**: */* + # **testClientModel** -> Client testClientModel(body) +> Client testClientModel(client) To test \"client\" model @@ -209,10 +232,13 @@ To test \"client\" model //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model + +Client 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 +250,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -239,9 +266,10 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json + # **testEndpointParameters** -> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) +> testEndpointParameters(body) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -250,36 +278,17 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン ### 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.FakeApi; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure HTTP basic authorization: http_basic_test -HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); -http_basic_test.setUsername("YOUR USERNAME"); -http_basic_test.setPassword("YOUR PASSWORD"); 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 -Integer integer = 56; // Integer | None -Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None -Float _float = 3.4F; // Float | None -String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None -LocalDate date = new LocalDate(); // LocalDate | None -OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None -String password = "password_example"; // String | None -String paramCallback = "paramCallback_example"; // String | None + +Object body = ; // Object | + try { - apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + apiInstance.testEndpointParameters(body); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEndpointParameters"); e.printStackTrace(); @@ -290,20 +299,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **number** | **BigDecimal**| None | - **_double** | **Double**| None | - **patternWithoutDelimiter** | **String**| None | - **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] - **int64** | **Long**| None | [optional] - **_float** | **Float**| None | [optional] - **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] - **date** | **LocalDate**| None | [optional] - **dateTime** | **OffsetDateTime**| None | [optional] - **password** | **String**| None | [optional] - **paramCallback** | **String**| None | [optional] + **body** | [**Object**](Object.md)| | + ### Return type @@ -316,11 +313,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 + - **Accept**: Not defined + # **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger) To test enum parameters @@ -333,17 +331,23 @@ To test enum parameters //import io.swagger.client.api.FakeApi; + 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) + +Object body = ; // Object | + List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) -String enumHeaderString = "-efg"; // String | Header parameter enum test (string) + +String enumHeaderString = Arrays.asList("enumHeaderString_example"); // 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) + +String enumQueryString = Arrays.asList("enumQueryString_example"); // String | Query parameter enum test (string) + +Integer enumQueryInteger = Arrays.asList(56); // Integer | Query parameter enum test (double) + try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + apiInstance.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -354,14 +358,13 @@ 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] + **body** | [**Object**](Object.md)| | [optional] + **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: ] + **enumHeaderString** | [**String**](.md)| Header parameter enum test (string) | [optional] + **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: ] + **enumQueryString** | [**String**](.md)| Query parameter enum test (string) | [optional] + **enumQueryInteger** | [**Integer**](.md)| Query parameter enum test (double) | [optional] + ### Return type @@ -374,16 +377,62 @@ No authorization required ### HTTP request headers - **Content-Type**: */* - - **Accept**: */* + - **Accept**: Not defined + + + +# **testInlineAdditionalProperties** +> testInlineAdditionalProperties(body) + +test inline additionalProperties + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.FakeApi; + + + +FakeApi apiInstance = new FakeApi(); + +Map body = ; // Map | request body + +try { + apiInstance.testInlineAdditionalProperties(body); +} catch (ApiException e) { + System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Map<String, String>**](Map.md)| request body | + + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + # **testJsonFormData** -> testJsonFormData(param, param2) +> testJsonFormData(body) test json serialization of form data - - ### Example ```java // Import classes: @@ -391,11 +440,13 @@ test json serialization of form data //import io.swagger.client.api.FakeApi; + FakeApi apiInstance = new FakeApi(); -String param = "param_example"; // String | field1 -String param2 = "param2_example"; // String | field2 + +Object body = ; // Object | + try { - apiInstance.testJsonFormData(param, param2); + apiInstance.testJsonFormData(body); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testJsonFormData"); e.printStackTrace(); @@ -406,8 +457,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **param** | **String**| field1 | - **param2** | **String**| field2 | + **body** | [**Object**](Object.md)| | + ### Return type @@ -422,3 +473,5 @@ No authorization required - **Content-Type**: application/json - **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..2bcbbb7908f 100644 --- a/samples/client/petstore/java/vertx/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/vertx/docs/FakeClassnameTags123Api.md @@ -7,33 +7,28 @@ Method | HTTP request | Description [**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case + + # **testClassname** -> Client testClassname(body) +> Client testClassname(client) To test class name in snake case ### 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.FakeClassnameTags123Api; -ApiClient defaultClient = Configuration.getDefaultApiClient(); -// Configure API key authorization: api_key_query -ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); -api_key_query.setApiKey("YOUR API KEY"); -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key_query.setApiKeyPrefix("Token"); FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model + +Client 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 +40,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | + **client** | [**Client**](.md)| client model | + ### Return type @@ -60,3 +56,5 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json + + diff --git a/samples/client/petstore/java/vertx/docs/FormatTest.md b/samples/client/petstore/java/vertx/docs/FormatTest.md index c7a3acb3cb7..bc11b93cb26 100644 --- a/samples/client/petstore/java/vertx/docs/FormatTest.md +++ b/samples/client/petstore/java/vertx/docs/FormatTest.md @@ -11,8 +11,8 @@ Name | Type | Description | Notes **_float** | **Float** | | [optional] **_double** | **Double** | | [optional] **string** | **String** | | [optional] -**_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] +**_byte** | **String** | | +**binary** | **String** | | [optional] **date** | [**LocalDate**](LocalDate.md) | | **dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] **uuid** | [**UUID**](UUID.md) | | [optional] @@ -20,3 +20,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/vertx/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/vertx/docs/HasOnlyReadOnly.md index c1d0aac5672..5564ddcf28a 100644 --- a/samples/client/petstore/java/vertx/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/java/vertx/docs/HasOnlyReadOnly.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/vertx/docs/MapTest.md b/samples/client/petstore/java/vertx/docs/MapTest.md index 714a97a40d9..74a6fe8ae70 100644 --- a/samples/client/petstore/java/vertx/docs/MapTest.md +++ b/samples/client/petstore/java/vertx/docs/MapTest.md @@ -8,12 +8,11 @@ Name | Type | Description | Notes **mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] + ## Enum: Map<String, InnerEnum> Name | Value ---- | ----- -UPPER | "UPPER" -LOWER | "lower" diff --git a/samples/client/petstore/java/vertx/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/vertx/docs/MixedPropertiesAndAdditionalPropertiesClass.md index b12e2cd70e6..4507481b5a9 100644 --- a/samples/client/petstore/java/vertx/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/vertx/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/vertx/docs/Model200Response.md b/samples/client/petstore/java/vertx/docs/Model200Response.md index 5b3a9a0e46d..8d2cc50bb83 100644 --- a/samples/client/petstore/java/vertx/docs/Model200Response.md +++ b/samples/client/petstore/java/vertx/docs/Model200Response.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/vertx/docs/ModelApiResponse.md b/samples/client/petstore/java/vertx/docs/ModelApiResponse.md index 3eec8686cc9..06052b202f1 100644 --- a/samples/client/petstore/java/vertx/docs/ModelApiResponse.md +++ b/samples/client/petstore/java/vertx/docs/ModelApiResponse.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/vertx/docs/ModelReturn.md b/samples/client/petstore/java/vertx/docs/ModelReturn.md index a679b04953e..a7845ba254b 100644 --- a/samples/client/petstore/java/vertx/docs/ModelReturn.md +++ b/samples/client/petstore/java/vertx/docs/ModelReturn.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/vertx/docs/Name.md b/samples/client/petstore/java/vertx/docs/Name.md index ce2fb4dee50..a8d6fec9714 100644 --- a/samples/client/petstore/java/vertx/docs/Name.md +++ b/samples/client/petstore/java/vertx/docs/Name.md @@ -11,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/vertx/docs/NumberOnly.md b/samples/client/petstore/java/vertx/docs/NumberOnly.md index a3feac7fadc..adfb36a95bb 100644 --- a/samples/client/petstore/java/vertx/docs/NumberOnly.md +++ b/samples/client/petstore/java/vertx/docs/NumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/vertx/docs/Order.md b/samples/client/petstore/java/vertx/docs/Order.md index 268c617d1ff..7e4beff6df1 100644 --- a/samples/client/petstore/java/vertx/docs/Order.md +++ b/samples/client/petstore/java/vertx/docs/Order.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/vertx/docs/OuterComposite.md b/samples/client/petstore/java/vertx/docs/OuterComposite.md index 3f5a633c998..1963c7a0f73 100644 --- a/samples/client/petstore/java/vertx/docs/OuterComposite.md +++ b/samples/client/petstore/java/vertx/docs/OuterComposite.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/vertx/docs/Pet.md b/samples/client/petstore/java/vertx/docs/Pet.md index 5b63109ef92..1492195a58d 100644 --- a/samples/client/petstore/java/vertx/docs/Pet.md +++ b/samples/client/petstore/java/vertx/docs/Pet.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + ## Enum: StatusEnum Name | Value diff --git a/samples/client/petstore/java/vertx/docs/PetApi.md b/samples/client/petstore/java/vertx/docs/PetApi.md index 022fd697a8d..4758743434a 100644 --- a/samples/client/petstore/java/vertx/docs/PetApi.md +++ b/samples/client/petstore/java/vertx/docs/PetApi.md @@ -14,33 +14,28 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image + + # **addPet** -> addPet(body) +> addPet(pet) 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 + +Pet 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 +46,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -64,7 +60,8 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **deletePet** @@ -72,26 +69,20 @@ null (empty response body) 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 | + +Integer petId = Arrays.asList(56); // Integer | Pet id to delete + +String apiKey = Arrays.asList("apiKey_example"); // String | + try { apiInstance.deletePet(petId, apiKey); } catch (ApiException e) { @@ -104,8 +95,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | - **apiKey** | **String**| | [optional] + **petId** | [**Integer**](.md)| Pet id to delete | + **apiKey** | [**String**](.md)| | [optional] + ### Return type @@ -118,7 +110,8 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **findPetsByStatus** @@ -131,20 +124,15 @@ 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); @@ -158,7 +146,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: ] + ### Return type @@ -173,6 +162,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **findPetsByTags** > List<Pet> findPetsByTags(tags) @@ -184,20 +174,15 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 ### 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); @@ -213,6 +198,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | + ### Return type [**List<Pet>**](Pet.md) @@ -226,6 +212,7 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **getPetById** > Pet getPetById(petId) @@ -237,22 +224,15 @@ 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet to return + try { Pet result = apiInstance.getPetById(petId); System.out.println(result); @@ -266,7 +246,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to return | + **petId** | [**Integer**](.md)| ID of pet to return | + ### Return type @@ -281,33 +262,27 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **updatePet** -> updatePet(body) +> updatePet(pet) 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 + +Pet 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 +293,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](.md)| Pet object that needs to be added to the store | + ### Return type @@ -331,37 +307,31 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updatePetWithForm** -> updatePetWithForm(petId, name, status) +> updatePetWithForm(petId, body) 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 + +Integer petId = Arrays.asList(56); // Integer | ID of pet that needs to be updated + +Object body = ; // Object | + try { - apiInstance.updatePetWithForm(petId, name, status); + apiInstance.updatePetWithForm(petId, body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePetWithForm"); e.printStackTrace(); @@ -372,9 +342,9 @@ try { 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] + **petId** | [**Integer**](.md)| ID of pet that needs to be updated | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -387,37 +357,31 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **uploadFile** -> ModelApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, body) 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 -AsyncFile file = new AsyncFile(); // AsyncFile | file to upload + +Integer petId = Arrays.asList(56); // Integer | ID of pet to update + +Object body = ; // Object | + try { - ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); + ModelApiResponse result = apiInstance.uploadFile(petId, body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling PetApi#uploadFile"); @@ -429,9 +393,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to update | - **additionalMetadata** | **String**| Additional data to pass to server | [optional] - **file** | **AsyncFile**| file to upload | [optional] + **petId** | [**Integer**](.md)| ID of pet to update | + **body** | [**Object**](Object.md)| | [optional] + ### Return type @@ -446,3 +410,5 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json + + diff --git a/samples/client/petstore/java/vertx/docs/ReadOnlyFirst.md b/samples/client/petstore/java/vertx/docs/ReadOnlyFirst.md index 426b7cde95a..57655e5b49e 100644 --- a/samples/client/petstore/java/vertx/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/java/vertx/docs/ReadOnlyFirst.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/vertx/docs/SpecialModelName.md b/samples/client/petstore/java/vertx/docs/SpecialModelName.md index c2c6117c552..f4259d2a73c 100644 --- a/samples/client/petstore/java/vertx/docs/SpecialModelName.md +++ b/samples/client/petstore/java/vertx/docs/SpecialModelName.md @@ -4,7 +4,8 @@ ## 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..a4678ee745c 100644 --- a/samples/client/petstore/java/vertx/docs/StoreApi.md +++ b/samples/client/petstore/java/vertx/docs/StoreApi.md @@ -10,6 +10,8 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + # **deleteOrder** > deleteOrder(orderId) @@ -25,8 +27,11 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -String orderId = "orderId_example"; // String | ID of the order that needs to be deleted + +String orderId = Arrays.asList("orderId_example"); // String | ID of the order that needs to be deleted + try { apiInstance.deleteOrder(orderId); } catch (ApiException e) { @@ -39,7 +44,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | + **orderId** | [**String**](.md)| ID of the order that needs to be deleted | + ### Return type @@ -52,7 +58,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getInventory** @@ -65,21 +72,13 @@ 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); @@ -92,6 +91,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type **Map<String, Integer>** @@ -105,6 +105,7 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json + # **getOrderById** > Order getOrderById(orderId) @@ -120,8 +121,11 @@ For valid response try integer IDs with value <= 5 or > 10. Other val //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched + +Integer orderId = Arrays.asList(56); // Integer | ID of pet that needs to be fetched + try { Order result = apiInstance.getOrderById(orderId); System.out.println(result); @@ -135,7 +139,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | + **orderId** | [**Integer**](.md)| ID of pet that needs to be fetched | + ### Return type @@ -150,14 +155,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```java // Import classes: @@ -165,10 +169,13 @@ Place an order for a pet //import io.swagger.client.api.StoreApi; + StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet + +Order 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 +187,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](.md)| order placed for purchasing the pet | + ### Return type @@ -192,6 +200,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: */* - **Accept**: application/xml, application/json + + diff --git a/samples/client/petstore/java/vertx/docs/Tag.md b/samples/client/petstore/java/vertx/docs/Tag.md index de6814b55d5..7a97d4c6812 100644 --- a/samples/client/petstore/java/vertx/docs/Tag.md +++ b/samples/client/petstore/java/vertx/docs/Tag.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/vertx/docs/User.md b/samples/client/petstore/java/vertx/docs/User.md index 8b6753dd284..cf7f9ce1312 100644 --- a/samples/client/petstore/java/vertx/docs/User.md +++ b/samples/client/petstore/java/vertx/docs/User.md @@ -15,3 +15,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/vertx/docs/UserApi.md b/samples/client/petstore/java/vertx/docs/UserApi.md index 2e6987951c8..e421376ce79 100644 --- a/samples/client/petstore/java/vertx/docs/UserApi.md +++ b/samples/client/petstore/java/vertx/docs/UserApi.md @@ -14,9 +14,11 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + # **createUser** -> createUser(body) +> createUser(user) Create user @@ -29,10 +31,13 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object + +User 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 +48,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](.md)| Created user object | + ### Return type @@ -55,8 +61,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithArrayInput** @@ -64,8 +71,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -73,8 +78,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { @@ -89,6 +97,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type null (empty response body) @@ -99,8 +108,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **createUsersWithListInput** @@ -108,8 +118,6 @@ No authorization required Creates list of users with given input array - - ### Example ```java // Import classes: @@ -117,8 +125,11 @@ Creates list of users with given input array //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object + +List body = ; // List | List of user object + try { apiInstance.createUsersWithListInput(body); } catch (ApiException e) { @@ -133,6 +144,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**List<User>**](User.md)| List of user object | + ### Return type null (empty response body) @@ -143,8 +155,9 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + # **deleteUser** @@ -161,8 +174,11 @@ This can only be done by the logged in user. //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be deleted + +String username = Arrays.asList("username_example"); // String | The name that needs to be deleted + try { apiInstance.deleteUser(username); } catch (ApiException e) { @@ -175,7 +191,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | + **username** | [**String**](.md)| The name that needs to be deleted | + ### Return type @@ -188,7 +205,8 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **getUserByName** @@ -196,8 +214,6 @@ No authorization required Get user by user name - - ### Example ```java // Import classes: @@ -205,8 +221,11 @@ Get user by user name //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. + +String username = Arrays.asList("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 +239,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + **username** | [**String**](.md)| The name that needs to be fetched. Use user1 for testing. | + ### Return type @@ -235,14 +255,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **loginUser** > String loginUser(username, password) Logs user into the system - - ### Example ```java // Import classes: @@ -250,9 +269,13 @@ Logs user into the system //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 + +String username = Arrays.asList("username_example"); // String | The user name for login + +String password = Arrays.asList("password_example"); // String | The password for login in clear text + try { String result = apiInstance.loginUser(username, password); System.out.println(result); @@ -266,8 +289,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | + **username** | [**String**](.md)| The user name for login | + **password** | [**String**](.md)| The password for login in clear text | + ### Return type @@ -282,14 +306,13 @@ No authorization required - **Content-Type**: Not defined - **Accept**: application/xml, application/json + # **logoutUser** > logoutUser() Logs out current logged in user session - - ### Example ```java // Import classes: @@ -297,7 +320,9 @@ Logs out current logged in user session //import io.swagger.client.api.UserApi; + UserApi apiInstance = new UserApi(); + try { apiInstance.logoutUser(); } catch (ApiException e) { @@ -309,6 +334,7 @@ try { ### Parameters This endpoint does not need any parameter. + ### Return type null (empty response body) @@ -320,11 +346,12 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined + # **updateUser** -> updateUser(username, body) +> updateUser(user, username) Updated user @@ -337,11 +364,15 @@ This can only be done by the logged in user. //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 + +User user = ; // User | Updated user object + +String username = Arrays.asList("username_example"); // String | name that need to be deleted + try { - apiInstance.updateUser(username, body); + apiInstance.updateUser(user, username); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -352,8 +383,9 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](.md)| Updated user object | + **username** | [**String**](.md)| name that need to be deleted | + ### Return type @@ -365,6 +397,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Content-Type**: */* + - **Accept**: Not defined + + diff --git a/samples/client/petstore/java/vertx/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/vertx/gradle/wrapper/gradle-wrapper.jar index 2c6137b8789..e69de29bb2d 100644 Binary files a/samples/client/petstore/java/vertx/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/vertx/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/vertx/pom.xml b/samples/client/petstore/java/vertx/pom.xml index 08e8352272e..51159c8d24c 100644 --- a/samples/client/petstore/java/vertx/pom.xml +++ b/samples/client/petstore/java/vertx/pom.xml @@ -212,16 +212,21 @@ jackson-databind ${jackson-version} + + com.fasterxml.jackson.datatype jackson-datatype-jsr310 ${jackson-version} + + com.github.joschi.jackson jackson-datatype-threetenbp ${jackson-version} + 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..d977516cab8 --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -0,0 +1,19 @@ +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..5842a68fbd0 --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/AnotherFakeApiImpl.java @@ -0,0 +1,85 @@ +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..2f5e9597618 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 @@ -2,9 +2,8 @@ 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.vertx.core.AsyncResult; import io.vertx.core.Handler; import io.vertx.core.json.JsonObject; @@ -13,20 +12,34 @@ public interface FakeApi { + + void fakeOuterBooleanSerialize(Boolean body, 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 testClientModel(Client client, Handler> handler); + + + void testEndpointParameters(Object body, 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 testEnumParameters(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Handler> handler); - void testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, Handler> handler); + + void testInlineAdditionalProperties(Map body, Handler> handler); - void testJsonFormData(String param, String param2, Handler> handler); + + void testJsonFormData(Object body, 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..75a7324a9f0 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 @@ -2,10 +2,9 @@ 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.vertx.core.AsyncResult; import io.vertx.core.Handler; import io.vertx.core.MultiMap; @@ -21,6 +20,7 @@ import io.swagger.client.Pair; + public class FakeApiImpl implements FakeApi { private ApiClient apiClient; @@ -41,10 +41,13 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @param resultHandler Asynchronous result handler */ public void fakeOuterBooleanSerialize(Boolean body, Handler> resultHandler) { @@ -55,52 +58,66 @@ public void fakeOuterBooleanSerialize(Boolean body, Handler // 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 = { }; + + 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); } + /** * * 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"; // 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 = { }; + + 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); } + /** * * Test serialization of outer number types + * @param body Input number as post body (optional) + * @param resultHandler Asynchronous result handler */ public void fakeOuterNumberSerialize(BigDecimal body, Handler> resultHandler) { @@ -111,24 +128,31 @@ public void fakeOuterNumberSerialize(BigDecimal body, Handler 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 = { }; + + 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); } + /** * * Test serialization of outer string types + * @param body Input string as post body (optional) + * @param resultHandler Asynchronous result handler */ public void fakeOuterStringSerialize(String body, Handler> resultHandler) { @@ -139,32 +163,39 @@ public void fakeOuterStringSerialize(String body, Handler> r // 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 = { }; + + 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 client client model (required) + * @param resultHandler Asynchronous result handler */ - public void testClientModel(Client body, Handler> resultHandler) { - Object localVarBody = body; + public void testClientModel(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 testClientModel")); + // verify the required parameter 'client' is set + if (client == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'client' when calling testClientModel")); return; } @@ -173,63 +204,39 @@ public void testClientModel(Client body, Handler> resultHand // 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); } + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) + + * @param body (required) + * @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) { - Object localVarBody = null; - - // verify the required parameter 'number' is set - if (number == null) { - resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'number' when calling testEndpointParameters")); - return; - } - - // verify the required parameter '_double' is set - if (_double == null) { - resultHandler.handle(ApiException.fail(400, "Missing the required parameter '_double' when calling testEndpointParameters")); - return; - } - - // verify the required parameter 'patternWithoutDelimiter' is set - if (patternWithoutDelimiter == null) { - resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters")); - return; - } + public void testEndpointParameters(Object body, Handler> resultHandler) { + Object localVarBody = body; - // verify the required parameter '_byte' is set - if (_byte == null) { - resultHandler.handle(ApiException.fail(400, "Missing the required parameter '_byte' when calling testEndpointParameters")); + // verify the required parameter 'body' is set + if (body == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'body' when calling testEndpointParameters")); return; } @@ -238,98 +245,132 @@ public void testEndpointParameters(BigDecimal number, Double _double, String pat // 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<>(); - if (integer != null) localVarFormParams.put("integer", integer); -if (int32 != null) localVarFormParams.put("int32", int32); -if (int64 != null) localVarFormParams.put("int64", int64); -if (number != null) localVarFormParams.put("number", number); -if (_float != null) localVarFormParams.put("float", _float); -if (_double != null) localVarFormParams.put("double", _double); -if (string != null) localVarFormParams.put("string", string); -if (patternWithoutDelimiter != null) localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter); -if (_byte != null) localVarFormParams.put("byte", _byte); -if (binary != null) localVarFormParams.put("binary", binary); -if (date != null) localVarFormParams.put("date", date); -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[] localVarAccepts = { }; String[] localVarContentTypes = { "application/xml; charset=utf-8", "application/json; charset=utf-8" }; String[] localVarAuthNames = new String[] { "http_basic_test" }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, 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 body (optional) + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + + * @param enumHeaderString Header parameter enum test (string) (optional) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + + * @param enumQueryString Query parameter enum test (string) (optional) + * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (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) { - Object localVarBody = null; + public void testEnumParameters(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Handler> resultHandler) { + Object localVarBody = body; // create path and map variables String localVarPath = "/fake"; // query params List localVarQueryParams = new ArrayList<>(); - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray)); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string_array", enumQueryStringArray)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger)); + // header params MultiMap localVarHeaderParams = MultiMap.caseInsensitiveMultiMap(); if (enumHeaderStringArray != null) localVarHeaderParams.add("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); -if (enumHeaderString != null) + if (enumHeaderString != null) localVarHeaderParams.add("enum_header_string", apiClient.parameterToString(enumHeaderString)); + // form params // TODO: sending files within multipart/form-data is not supported yet (because of vertx web-client) 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[] localVarAccepts = { }; String[] localVarContentTypes = { "*/*" }; String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); } + /** - * test json serialization of form data + * test inline additionalProperties * - * @param param field1 (required) - * @param param2 field2 (required) + + * @param body request body (required) + * @param resultHandler Asynchronous result handler */ - public void testJsonFormData(String param, String param2, Handler> resultHandler) { - Object localVarBody = null; + public void testInlineAdditionalProperties(Map body, Handler> resultHandler) { + Object localVarBody = body; - // verify the required parameter 'param' is set - if (param == null) { - resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'param' when calling testJsonFormData")); + // verify the required parameter 'body' is set + if (body == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'body' when calling testInlineAdditionalProperties")); return; } - // verify the required parameter 'param2' is set - if (param2 == null) { - resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'param2' when calling testJsonFormData")); + // 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 + * + + * @param body (required) + + * @param resultHandler Asynchronous result handler + */ + public void testJsonFormData(Object body, Handler> resultHandler) { + Object localVarBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'body' when calling testJsonFormData")); return; } @@ -338,20 +379,23 @@ public void testJsonFormData(String param, String param2, Handler 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<>(); - if (param != null) localVarFormParams.put("param", param); -if (param2 != null) localVarFormParams.put("param2", param2); + String[] localVarAccepts = { }; String[] localVarContentTypes = { "application/json" }; 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..69b6c55fae4 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 @@ -1,6 +1,7 @@ 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; @@ -9,6 +10,10 @@ 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..33abfa334b8 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 @@ -2,6 +2,7 @@ import io.swagger.client.model.Client; + import io.vertx.core.AsyncResult; import io.vertx.core.Handler; import io.vertx.core.MultiMap; @@ -17,6 +18,7 @@ import io.swagger.client.Pair; + public class FakeClassnameTags123ApiImpl implements FakeClassnameTags123Api { private ApiClient apiClient; @@ -37,18 +39,21 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * To test class name in snake case * - * @param body client model (required) + + * @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; } @@ -57,18 +62,24 @@ public void testClassname(Client body, Handler> resultHandle // 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[] { "api_key_query" }; + 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/PetApi.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/PetApi.java index 79d5552087a..98b13588efa 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 @@ -1,8 +1,8 @@ package io.swagger.client.api; -import io.vertx.core.file.AsyncFile; import io.swagger.client.model.ModelApiResponse; import io.swagger.client.model.Pet; + import io.vertx.core.AsyncResult; import io.vertx.core.Handler; import io.vertx.core.json.JsonObject; @@ -11,20 +11,31 @@ public interface PetApi { - void addPet(Pet body, Handler> handler); + + + void addPet(Pet pet, Handler> handler); - void deletePet(Long petId, String apiKey, Handler> handler); + + void deletePet(Integer petId, String apiKey, Handler> handler); + void findPetsByStatus(List status, Handler>> handler); + void findPetsByTags(List tags, Handler>> handler); - void getPetById(Long petId, Handler> handler); + + void getPetById(Integer 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); + + void updatePetWithForm(Integer petId, Object body, Handler> handler); - void uploadFile(Long petId, String additionalMetadata, AsyncFile file, Handler> handler); + + void uploadFile(Integer petId, Object body, 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..efe4d2bef86 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 @@ -1,9 +1,9 @@ package io.swagger.client.api; -import io.vertx.core.file.AsyncFile; import io.swagger.client.model.ModelApiResponse; import io.swagger.client.model.Pet; + import io.vertx.core.AsyncResult; import io.vertx.core.Handler; import io.vertx.core.MultiMap; @@ -19,6 +19,7 @@ import io.swagger.client.Pair; + public class PetApiImpl implements PetApi { private ApiClient apiClient; @@ -39,18 +40,21 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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; } @@ -59,28 +63,35 @@ public void addPet(Pet body, Handler> resultHandler) { // 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/xml", "application/json" }; + + String[] localVarAccepts = { }; String[] localVarContentTypes = { "application/json", "application/xml" }; String[] localVarAuthNames = new String[] { "petstore_auth" }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); } + /** * Deletes a pet * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @param resultHandler Asynchronous result handler */ - public void deletePet(Long petId, String apiKey, Handler> resultHandler) { + public void deletePet(Integer petId, String apiKey, Handler> resultHandler) { Object localVarBody = null; // verify the required parameter 'petId' is set @@ -94,26 +105,32 @@ public void deletePet(Long petId, String apiKey, Handler> resu // query params List localVarQueryParams = new ArrayList<>(); + // header params MultiMap localVarHeaderParams = MultiMap.caseInsensitiveMultiMap(); if (apiKey != null) localVarHeaderParams.add("api_key", apiClient.parameterToString(apiKey)); + // 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/xml", "application/json" }; + + String[] localVarAccepts = { }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { "petstore_auth" }; - + apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @param resultHandler Asynchronous result handler */ public void findPetsByStatus(List status, Handler>> resultHandler) { @@ -130,25 +147,33 @@ public void findPetsByStatus(List status, Handler> // query params List localVarQueryParams = new ArrayList<>(); - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status)); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status)); + // 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/xml", "application/json" }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { "petstore_auth" }; + TypeReference> localVarReturnType = new TypeReference>() {}; apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); } + /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @param resultHandler Asynchronous result handler */ public void findPetsByTags(List tags, Handler>> resultHandler) { @@ -165,28 +190,36 @@ public void findPetsByTags(List tags, Handler>> re // query params List localVarQueryParams = new ArrayList<>(); - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags)); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "tags", tags)); + // 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/xml", "application/json" }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { "petstore_auth" }; + TypeReference> localVarReturnType = new TypeReference>() {}; apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); } + /** * Find pet by ID * Returns a single pet + * @param petId ID of pet to return (required) + * @param resultHandler Asynchronous result handler */ - public void getPetById(Long petId, Handler> resultHandler) { + public void getPetById(Integer petId, Handler> resultHandler) { Object localVarBody = null; // verify the required parameter 'petId' is set @@ -200,32 +233,39 @@ public void getPetById(Long petId, Handler> resultHandler) { // 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/xml", "application/json" }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { "api_key" }; + TypeReference localVarReturnType = new TypeReference() {}; apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, 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) + * @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; } @@ -234,30 +274,36 @@ public void updatePet(Pet body, Handler> resultHandler) { // 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/xml", "application/json" }; + + String[] localVarAccepts = { }; String[] localVarContentTypes = { "application/json", "application/xml" }; String[] localVarAuthNames = new String[] { "petstore_auth" }; - + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); } + /** * Updates a pet in the store with form data * + * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) + + * @param body (optional) + * @param resultHandler Asynchronous result handler */ - public void updatePetWithForm(Long petId, String name, String status, Handler> resultHandler) { - Object localVarBody = null; + public void updatePetWithForm(Integer petId, Object body, Handler> resultHandler) { + Object localVarBody = body; // verify the required parameter 'petId' is set if (petId == null) { @@ -270,32 +316,36 @@ public void updatePetWithForm(Long petId, String name, String status, Handler 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<>(); - 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" }; - + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); } + /** * uploads an image * + * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) + + * @param body (optional) + * @param resultHandler Asynchronous result handler */ - public void uploadFile(Long petId, String additionalMetadata, AsyncFile file, Handler> resultHandler) { - Object localVarBody = null; + public void uploadFile(Integer petId, Object body, Handler> resultHandler) { + Object localVarBody = body; // verify the required parameter 'petId' is set if (petId == null) { @@ -308,20 +358,24 @@ public void uploadFile(Long petId, String additionalMetadata, AsyncFile file, Ha // 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<>(); - if (additionalMetadata != null) localVarFormParams.put("additionalMetadata", additionalMetadata); -if (file != null) localVarFormParams.put("file", file); + String[] localVarAccepts = { "application/json" }; String[] localVarContentTypes = { "multipart/form-data" }; String[] localVarAuthNames = new String[] { "petstore_auth" }; + TypeReference localVarReturnType = new TypeReference() {}; apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); } + } + 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..c6a62637279 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 @@ -1,6 +1,7 @@ package io.swagger.client.api; import io.swagger.client.model.Order; + import io.vertx.core.AsyncResult; import io.vertx.core.Handler; import io.vertx.core.json.JsonObject; @@ -9,12 +10,19 @@ public interface StoreApi { + + void deleteOrder(String orderId, Handler> handler); + void getInventory(Handler>> handler); - void getOrderById(Long orderId, Handler> handler); + + void getOrderById(Integer 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..3c073f1666e 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 @@ -2,6 +2,7 @@ import io.swagger.client.model.Order; + import io.vertx.core.AsyncResult; import io.vertx.core.Handler; import io.vertx.core.MultiMap; @@ -17,6 +18,7 @@ import io.swagger.client.Pair; + public class StoreApiImpl implements StoreApi { private ApiClient apiClient; @@ -37,10 +39,13 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @param resultHandler Asynchronous result handler */ public void deleteOrder(String orderId, Handler> resultHandler) { @@ -57,23 +62,28 @@ public void deleteOrder(String orderId, Handler> resultHandler // 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/xml", "application/json" }; + + String[] localVarAccepts = { }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); } + /** * Returns pet inventories by status * Returns a map of status codes to quantities + * @param resultHandler Asynchronous result handler */ public void getInventory(Handler>> resultHandler) { @@ -84,27 +94,34 @@ public void getInventory(Handler>> resultHandle // 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 = { }; String[] localVarAuthNames = new String[] { "api_key" }; + TypeReference> localVarReturnType = new TypeReference>() {}; apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); } + /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @param resultHandler Asynchronous result handler */ - public void getOrderById(Long orderId, Handler> resultHandler) { + public void getOrderById(Integer orderId, Handler> resultHandler) { Object localVarBody = null; // verify the required parameter 'orderId' is set @@ -118,32 +135,39 @@ public void getOrderById(Long orderId, Handler> resultHandler // 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/xml", "application/json" }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; + TypeReference localVarReturnType = new TypeReference() {}; apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, 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) + * @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; } @@ -152,18 +176,24 @@ public void placeOrder(Order body, Handler> resultHandler) { // 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/xml", "application/json" }; - String[] localVarContentTypes = { }; + String[] localVarContentTypes = { "*/*" }; String[] localVarAuthNames = new String[] { }; + TypeReference localVarReturnType = new TypeReference() {}; apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); } + } + 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..902e044e6da 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 @@ -1,6 +1,7 @@ package io.swagger.client.api; import io.swagger.client.model.User; + import io.vertx.core.AsyncResult; import io.vertx.core.Handler; import io.vertx.core.json.JsonObject; @@ -9,20 +10,31 @@ public interface UserApi { - void createUser(User body, Handler> handler); + + + void createUser(User user, Handler> handler); + void createUsersWithArrayInput(List body, Handler> handler); + void createUsersWithListInput(List body, Handler> handler); + void deleteUser(String username, Handler> handler); + void getUserByName(String username, Handler> handler); + void loginUser(String username, String password, Handler> handler); + void logoutUser(Handler> handler); - void updateUser(String username, User body, Handler> handler); + + void updateUser(User user, String username, 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..7c1e27b5dcd 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 @@ -2,6 +2,7 @@ import io.swagger.client.model.User; + import io.vertx.core.AsyncResult; import io.vertx.core.Handler; import io.vertx.core.MultiMap; @@ -17,6 +18,7 @@ import io.swagger.client.Pair; + public class UserApiImpl implements UserApi { private ApiClient apiClient; @@ -37,18 +39,21 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * 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; } @@ -57,24 +62,30 @@ public void createUser(User body, Handler> resultHandler) { // 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/xml", "application/json" }; - String[] localVarContentTypes = { }; - String[] localVarAuthNames = new String[] { }; + String[] localVarAccepts = { }; + String[] localVarContentTypes = { "*/*" }; + String[] localVarAuthNames = new String[] { }; + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); } + /** * Creates list of users with given input array * + * @param body List of user object (required) + * @param resultHandler Asynchronous result handler */ public void createUsersWithArrayInput(List body, Handler> resultHandler) { @@ -91,24 +102,30 @@ public void createUsersWithArrayInput(List body, Handler // 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/xml", "application/json" }; - String[] localVarContentTypes = { }; - String[] localVarAuthNames = new String[] { }; + String[] localVarAccepts = { }; + String[] localVarContentTypes = { "*/*" }; + String[] localVarAuthNames = new String[] { }; + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); } + /** * Creates list of users with given input array * + * @param body List of user object (required) + * @param resultHandler Asynchronous result handler */ public void createUsersWithListInput(List body, Handler> resultHandler) { @@ -125,24 +142,30 @@ public void createUsersWithListInput(List body, Handler> // 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/xml", "application/json" }; - String[] localVarContentTypes = { }; - String[] localVarAuthNames = new String[] { }; + String[] localVarAccepts = { }; + String[] localVarContentTypes = { "*/*" }; + String[] localVarAuthNames = new String[] { }; + apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); } + /** * Delete user * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @param resultHandler Asynchronous result handler */ public void deleteUser(String username, Handler> resultHandler) { @@ -159,24 +182,30 @@ public void deleteUser(String username, Handler> resultHandler // 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/xml", "application/json" }; + + String[] localVarAccepts = { }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); } + /** * Get user by user name * + * @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) { @@ -193,25 +222,33 @@ public void getUserByName(String username, Handler> resultHand // 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/xml", "application/json" }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; + TypeReference localVarReturnType = new TypeReference() {}; apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); } + /** * Logs user into the system * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @param resultHandler Asynchronous result handler */ public void loginUser(String username, String password, Handler> resultHandler) { @@ -234,25 +271,33 @@ public void loginUser(String username, String password, Handler localVarQueryParams = new ArrayList<>(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "password", password)); + // 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/xml", "application/json" }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; + TypeReference localVarReturnType = new TypeReference() {}; apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, localVarReturnType, resultHandler); } + /** * Logs out current logged in user session * + * @param resultHandler Asynchronous result handler */ public void logoutUser(Handler> resultHandler) { @@ -263,39 +308,46 @@ public void logoutUser(Handler> resultHandler) { // 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/xml", "application/json" }; + + String[] localVarAccepts = { }; String[] localVarContentTypes = { }; String[] localVarAuthNames = new String[] { }; - + apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); } + /** * Updated user * This can only be done by the logged in user. + + * @param user Updated user object (required) + * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param resultHandler Asynchronous result handler */ - public void updateUser(String username, User body, Handler> resultHandler) { - Object localVarBody = body; + public void updateUser(User user, String username, Handler> resultHandler) { + Object localVarBody = user; - // verify the required parameter 'username' is set - if (username == null) { - resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'username' 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; } - // 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 'username' is set + if (username == null) { + resultHandler.handle(ApiException.fail(400, "Missing the required parameter 'username' when calling updateUser")); return; } @@ -304,18 +356,23 @@ public void updateUser(String username, User body, Handler> re // 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/xml", "application/json" }; - String[] localVarContentTypes = { }; - String[] localVarAuthNames = new String[] { }; + String[] localVarAccepts = { }; + String[] localVarContentTypes = { "*/*" }; + String[] localVarAuthNames = new String[] { }; + apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarBody, localVarHeaderParams, localVarFormParams, localVarAccepts, localVarContentTypes, localVarAuthNames, null, resultHandler); } + } + 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..0e62588f12d --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/api/rxjava/AnotherFakeApi.java @@ -0,0 +1,58 @@ +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..b70286d5da3 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 @@ -2,10 +2,9 @@ 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 java.util.*; import rx.Single; @@ -13,6 +12,7 @@ import io.vertx.core.Handler; + public class FakeApi { private final io.swagger.client.api.FakeApi delegate; @@ -25,10 +25,13 @@ public io.swagger.client.api.FakeApi getDelegate() { return delegate; } + /** * * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @param resultHandler Asynchronous result handler */ public void fakeOuterBooleanSerialize(Boolean body, Handler> resultHandler) { @@ -38,7 +41,9 @@ public void fakeOuterBooleanSerialize(Boolean body, Handler /** * * Test serialization of outer boolean types + * @param body Input boolean as post body (optional) + * @return Asynchronous result handler (RxJava Single) */ public Single rxFakeOuterBooleanSerialize(Boolean body) { @@ -46,31 +51,39 @@ public Single rxFakeOuterBooleanSerialize(Boolean body) { delegate.fakeOuterBooleanSerialize(body, 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); })); } + /** * * Test serialization of outer number types + * @param body Input number as post body (optional) + * @param resultHandler Asynchronous result handler */ public void fakeOuterNumberSerialize(BigDecimal body, Handler> resultHandler) { @@ -80,7 +93,9 @@ public void fakeOuterNumberSerialize(BigDecimal body, Handler rxFakeOuterNumberSerialize(BigDecimal body) { @@ -88,10 +103,13 @@ public Single rxFakeOuterNumberSerialize(BigDecimal body) { delegate.fakeOuterNumberSerialize(body, fut); })); } + /** * * Test serialization of outer string types + * @param body Input string as post body (optional) + * @param resultHandler Asynchronous result handler */ public void fakeOuterStringSerialize(String body, Handler> resultHandler) { @@ -101,7 +119,9 @@ public void fakeOuterStringSerialize(String body, Handler> r /** * * Test serialization of outer string types + * @param body Input string as post body (optional) + * @return Asynchronous result handler (RxJava Single) */ public Single rxFakeOuterStringSerialize(String body) { @@ -109,134 +129,160 @@ public Single rxFakeOuterStringSerialize(String body) { delegate.fakeOuterStringSerialize(body, fut); })); } + /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + + * @param client client model (required) + * @param resultHandler Asynchronous result handler */ - public void testClientModel(Client body, Handler> resultHandler) { - delegate.testClientModel(body, resultHandler); + 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); })); } + /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) + + * @param body (required) + * @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) { - delegate.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, resultHandler); + public void testEndpointParameters(Object body, Handler> resultHandler) { + delegate.testEndpointParameters(body, resultHandler); } /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) + + * @param body (required) + * @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(Object body) { 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); + delegate.testEndpointParameters(body, fut); })); } + /** * 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 body (optional) + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + + * @param enumHeaderString Header parameter enum test (string) (optional) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + + * @param enumQueryString Query parameter enum test (string) (optional) + * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (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(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Handler> resultHandler) { + delegate.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, 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 body (optional) + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + + * @param enumHeaderString Header parameter enum test (string) (optional) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + + * @param enumQueryString Query parameter enum test (string) (optional) + * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) + + * @return Asynchronous result handler (RxJava Single) + */ + public Single rxTestEnumParameters(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger) { + return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { + delegate.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, fut); + })); + } + + /** + * test inline additionalProperties + * + + * @param body request body (required) + + * @param resultHandler Asynchronous result handler + */ + public void testInlineAdditionalProperties(Map body, Handler> resultHandler) { + delegate.testInlineAdditionalProperties(body, resultHandler); + } + + /** + * test inline additionalProperties + * + + * @param body request body (required) + * @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 rxTestInlineAdditionalProperties(Map body) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, fut); + delegate.testInlineAdditionalProperties(body, fut); })); } + /** * test json serialization of form data * - * @param param field1 (required) - * @param param2 field2 (required) + + * @param body (required) + * @param resultHandler Asynchronous result handler */ - public void testJsonFormData(String param, String param2, Handler> resultHandler) { - delegate.testJsonFormData(param, param2, resultHandler); + public void testJsonFormData(Object body, Handler> resultHandler) { + delegate.testJsonFormData(body, resultHandler); } /** * test json serialization of form data * - * @param param field1 (required) - * @param param2 field2 (required) + + * @param body (required) + * @return Asynchronous result handler (RxJava Single) */ - public Single rxTestJsonFormData(String param, String param2) { + public Single rxTestJsonFormData(Object body) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.testJsonFormData(param, param2, fut); + delegate.testJsonFormData(body, fut); })); } + public static FakeApi newInstance(io.swagger.client.api.FakeApi arg) { return arg != null ? new FakeApi(arg) : null; } } + 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..62fa790ddec 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 @@ -2,6 +2,7 @@ import io.swagger.client.model.Client; + import java.util.*; import rx.Single; @@ -9,6 +10,7 @@ import io.vertx.core.Handler; + public class FakeClassnameTags123Api { private final io.swagger.client.api.FakeClassnameTags123Api delegate; @@ -21,29 +23,36 @@ public io.swagger.client.api.FakeClassnameTags123Api getDelegate() { return delegate; } + /** * To test class name in snake case * - * @param body client model (required) + + * @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) + + * @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); })); } + public static FakeClassnameTags123Api newInstance(io.swagger.client.api.FakeClassnameTags123Api arg) { return arg != null ? new FakeClassnameTags123Api(arg) : null; } } + 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..0fbdda2a4eb 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 @@ -1,9 +1,9 @@ package io.swagger.client.api.rxjava; -import io.vertx.core.file.AsyncFile; import io.swagger.client.model.ModelApiResponse; import io.swagger.client.model.Pet; + import java.util.*; import rx.Single; @@ -11,6 +11,7 @@ import io.vertx.core.Handler; + public class PetApi { private final io.swagger.client.api.PetApi delegate; @@ -23,54 +24,69 @@ public io.swagger.client.api.PetApi getDelegate() { return delegate; } + /** * 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); })); } + /** * Deletes a pet * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @param resultHandler Asynchronous result handler */ - public void deletePet(Long petId, String apiKey, Handler> resultHandler) { + public void deletePet(Integer petId, String apiKey, Handler> resultHandler) { delegate.deletePet(petId, apiKey, resultHandler); } /** * Deletes a pet * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Asynchronous result handler (RxJava Single) */ - public Single rxDeletePet(Long petId, String apiKey) { + public Single rxDeletePet(Integer petId, String apiKey) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { delegate.deletePet(petId, apiKey, fut); })); } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @param resultHandler Asynchronous result handler */ public void findPetsByStatus(List status, Handler>> resultHandler) { @@ -80,7 +96,9 @@ public void findPetsByStatus(List status, Handler> /** * Finds Pets by status * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter (required) + * @return Asynchronous result handler (RxJava Single) */ public Single> rxFindPetsByStatus(List status) { @@ -88,10 +106,13 @@ public Single> rxFindPetsByStatus(List status) { delegate.findPetsByStatus(status, fut); })); } + /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @param resultHandler Asynchronous result handler */ public void findPetsByTags(List tags, Handler>> resultHandler) { @@ -101,7 +122,9 @@ public void findPetsByTags(List tags, Handler>> re /** * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by (required) + * @return Asynchronous result handler (RxJava Single) */ public Single> rxFindPetsByTags(List tags) { @@ -109,100 +132,122 @@ public Single> rxFindPetsByTags(List tags) { delegate.findPetsByTags(tags, fut); })); } + /** * Find pet by ID * Returns a single pet + * @param petId ID of pet to return (required) + * @param resultHandler Asynchronous result handler */ - public void getPetById(Long petId, Handler> resultHandler) { + public void getPetById(Integer petId, Handler> resultHandler) { delegate.getPetById(petId, resultHandler); } /** * Find pet by ID * Returns a single pet + * @param petId ID of pet to return (required) + * @return Asynchronous result handler (RxJava Single) */ - public Single rxGetPetById(Long petId) { + public Single rxGetPetById(Integer petId) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { delegate.getPetById(petId, fut); })); } + /** * 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); })); } + /** * Updates a pet in the store with form data * + * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) + + * @param body (optional) + * @param resultHandler Asynchronous result handler */ - public void updatePetWithForm(Long petId, String name, String status, Handler> resultHandler) { - delegate.updatePetWithForm(petId, name, status, resultHandler); + public void updatePetWithForm(Integer petId, Object body, Handler> resultHandler) { + delegate.updatePetWithForm(petId, body, resultHandler); } /** * Updates a pet in the store with form data * + * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) + + * @param body (optional) + * @return Asynchronous result handler (RxJava Single) */ - public Single rxUpdatePetWithForm(Long petId, String name, String status) { + public Single rxUpdatePetWithForm(Integer petId, Object body) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.updatePetWithForm(petId, name, status, fut); + delegate.updatePetWithForm(petId, body, fut); })); } + /** * uploads an image * + * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) + + * @param body (optional) + * @param resultHandler Asynchronous result handler */ - public void uploadFile(Long petId, String additionalMetadata, AsyncFile file, Handler> resultHandler) { - delegate.uploadFile(petId, additionalMetadata, file, resultHandler); + public void uploadFile(Integer petId, Object body, Handler> resultHandler) { + delegate.uploadFile(petId, body, resultHandler); } /** * uploads an image * + * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) + + * @param body (optional) + * @return Asynchronous result handler (RxJava Single) */ - public Single rxUploadFile(Long petId, String additionalMetadata, AsyncFile file) { + public Single rxUploadFile(Integer petId, Object body) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.uploadFile(petId, additionalMetadata, file, fut); + delegate.uploadFile(petId, body, fut); })); } + public static PetApi newInstance(io.swagger.client.api.PetApi arg) { return arg != null ? new PetApi(arg) : null; } } + 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..2731231cbb5 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 @@ -2,6 +2,7 @@ import io.swagger.client.model.Order; + import java.util.*; import rx.Single; @@ -9,6 +10,7 @@ import io.vertx.core.Handler; + public class StoreApi { private final io.swagger.client.api.StoreApi delegate; @@ -21,10 +23,13 @@ public io.swagger.client.api.StoreApi getDelegate() { return delegate; } + /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @param resultHandler Asynchronous result handler */ public void deleteOrder(String orderId, Handler> resultHandler) { @@ -34,7 +39,9 @@ public void deleteOrder(String orderId, Handler> resultHandler /** * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted (required) + * @return Asynchronous result handler (RxJava Single) */ public Single rxDeleteOrder(String orderId) { @@ -42,9 +49,11 @@ public Single rxDeleteOrder(String orderId) { delegate.deleteOrder(orderId, fut); })); } + /** * Returns pet inventories by status * Returns a map of status codes to quantities + * @param resultHandler Asynchronous result handler */ public void getInventory(Handler>> resultHandler) { @@ -54,6 +63,7 @@ public void getInventory(Handler>> resultHandle /** * Returns pet inventories by status * Returns a map of status codes to quantities + * @return Asynchronous result handler (RxJava Single) */ public Single> rxGetInventory() { @@ -61,50 +71,62 @@ public Single> rxGetInventory() { delegate.getInventory(fut); })); } + /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @param resultHandler Asynchronous result handler */ - public void getOrderById(Long orderId, Handler> resultHandler) { + public void getOrderById(Integer orderId, Handler> resultHandler) { delegate.getOrderById(orderId, resultHandler); } /** * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched (required) + * @return Asynchronous result handler (RxJava Single) */ - public Single rxGetOrderById(Long orderId) { + public Single rxGetOrderById(Integer orderId) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { delegate.getOrderById(orderId, fut); })); } + /** * 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); })); } + public static StoreApi newInstance(io.swagger.client.api.StoreApi arg) { return arg != null ? new StoreApi(arg) : null; } } + 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..5c74c84dcdb 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 @@ -2,6 +2,7 @@ import io.swagger.client.model.User; + import java.util.*; import rx.Single; @@ -9,6 +10,7 @@ import io.vertx.core.Handler; + public class UserApi { private final io.swagger.client.api.UserApi delegate; @@ -21,31 +23,39 @@ public io.swagger.client.api.UserApi getDelegate() { return delegate; } + /** * 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 resultHandler Asynchronous result handler */ public void createUsersWithArrayInput(List body, Handler> resultHandler) { @@ -55,7 +65,9 @@ public void createUsersWithArrayInput(List body, Handler /** * Creates list of users with given input array * + * @param body List of user object (required) + * @return Asynchronous result handler (RxJava Single) */ public Single rxCreateUsersWithArrayInput(List body) { @@ -63,10 +75,13 @@ public Single rxCreateUsersWithArrayInput(List body) { delegate.createUsersWithArrayInput(body, fut); })); } + /** * Creates list of users with given input array * + * @param body List of user object (required) + * @param resultHandler Asynchronous result handler */ public void createUsersWithListInput(List body, Handler> resultHandler) { @@ -76,7 +91,9 @@ public void createUsersWithListInput(List body, Handler> /** * Creates list of users with given input array * + * @param body List of user object (required) + * @return Asynchronous result handler (RxJava Single) */ public Single rxCreateUsersWithListInput(List body) { @@ -84,10 +101,13 @@ public Single rxCreateUsersWithListInput(List body) { delegate.createUsersWithListInput(body, fut); })); } + /** * Delete user * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @param resultHandler Asynchronous result handler */ public void deleteUser(String username, Handler> resultHandler) { @@ -97,7 +117,9 @@ public void deleteUser(String username, Handler> resultHandler /** * Delete user * This can only be done by the logged in user. + * @param username The name that needs to be deleted (required) + * @return Asynchronous result handler (RxJava Single) */ public Single rxDeleteUser(String username) { @@ -105,10 +127,13 @@ public Single rxDeleteUser(String username) { delegate.deleteUser(username, fut); })); } + /** * Get user by user name * + * @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 +143,9 @@ public void getUserByName(String username, Handler> resultHand /** * Get user by user name * + * @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) { @@ -126,11 +153,15 @@ public Single rxGetUserByName(String username) { delegate.getUserByName(username, fut); })); } + /** * Logs user into the system * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @param resultHandler Asynchronous result handler */ public void loginUser(String username, String password, Handler> resultHandler) { @@ -140,8 +171,11 @@ public void loginUser(String username, String password, Handler rxLoginUser(String username, String password) { @@ -149,9 +183,11 @@ public Single rxLoginUser(String username, String password) { delegate.loginUser(username, password, fut); })); } + /** * Logs out current logged in user session * + * @param resultHandler Asynchronous result handler */ public void logoutUser(Handler> resultHandler) { @@ -161,6 +197,7 @@ public void logoutUser(Handler> resultHandler) { /** * Logs out current logged in user session * + * @return Asynchronous result handler (RxJava Single) */ public Single rxLogoutUser() { @@ -168,31 +205,40 @@ public Single rxLogoutUser() { delegate.logoutUser(fut); })); } + /** * Updated user * This can only be done by the logged in user. + + * @param user Updated user object (required) + * @param username name that need to be deleted (required) - * @param body 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(User user, String username, Handler> resultHandler) { + delegate.updateUser(user, username, resultHandler); } /** * Updated user * This can only be done by the logged in user. + + * @param user Updated user object (required) + * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @return Asynchronous result handler (RxJava Single) */ - public Single rxUpdateUser(String username, User body) { + public Single rxUpdateUser(User user, String username) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { - delegate.updateUser(username, body, fut); + delegate.updateUser(user, username, fut); })); } + public static UserApi newInstance(io.swagger.client.api.UserApi arg) { return arg != null ? new UserApi(arg) : null; } } + 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..946f6319432 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 @@ -28,65 +28,65 @@ */ public class AdditionalPropertiesClass { + @JsonProperty("map_property") private Map mapProperty = null; - + @JsonProperty("map_of_map_property") private Map> mapOfMapProperty = null; - + public AdditionalPropertiesClass mapProperty(Map mapProperty) { this.mapProperty = mapProperty; return this; } 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; } - - /** - * Get mapProperty - * @return mapProperty + /** + * Get mapProperty + * @return mapProperty **/ @ApiModelProperty(value = "") public Map getMapProperty() { return mapProperty; } - public void setMapProperty(Map mapProperty) { this.mapProperty = mapProperty; } - + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; return this; } public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { - this.mapOfMapProperty = new HashMap>(); + this.mapOfMapProperty = new HashMap<>(); } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } - - /** - * Get mapOfMapProperty - * @return mapOfMapProperty + /** + * Get mapOfMapProperty + * @return mapOfMapProperty **/ @ApiModelProperty(value = "") public Map> getMapOfMapProperty() { return mapOfMapProperty; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { this.mapOfMapProperty = mapOfMapProperty; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -104,8 +104,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapProperty, mapOfMapProperty); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -128,5 +127,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..ddd1f98533f 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 @@ -25,56 +25,60 @@ /** * Animal */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true ) + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "Discriminator{propertyName='className', mapping=null}", visible = true ) @JsonSubTypes({ + @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + }) public class Animal { + @JsonProperty("className") private String className = null; - + @JsonProperty("color") private String color = "red"; - + public Animal className(String className) { this.className = className; return this; } - /** - * Get className - * @return className + + /** + * Get className + * @return className **/ @ApiModelProperty(required = true, value = "") public String getClassName() { return className; } - public void setClassName(String className) { this.className = className; } - + public Animal color(String color) { this.color = color; return this; } - /** - * Get color - * @return color + + /** + * Get color + * @return color **/ @ApiModelProperty(value = "") public String getColor() { return color; } - public void setColor(String color) { this.color = color; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -92,8 +96,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(className, color); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -116,5 +119,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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 deleted file mode 100644 index 0b1d6a74cc6..00000000000 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/AnimalFarm.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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 io.swagger.client.model.Animal; -import java.util.ArrayList; -import java.util.List; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/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..3e850a94aa5 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 @@ -28,36 +28,37 @@ */ public class ArrayOfArrayOfNumberOnly { + @JsonProperty("ArrayArrayNumber") private List> arrayArrayNumber = null; - + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; return this; } public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); + this.arrayArrayNumber = new ArrayList<>(); } + this.arrayArrayNumber.add(arrayArrayNumberItem); return this; } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber **/ @ApiModelProperty(value = "") public List> getArrayArrayNumber() { return arrayArrayNumber; } - public void setArrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,8 +75,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayArrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -97,5 +97,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..8882f76ab46 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 @@ -28,36 +28,37 @@ */ public class ArrayOfNumberOnly { + @JsonProperty("ArrayNumber") private List arrayNumber = null; - + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; return this; } public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); + this.arrayNumber = new ArrayList<>(); } + this.arrayNumber.add(arrayNumberItem); return this; } - - /** - * Get arrayNumber - * @return arrayNumber + + /** + * Get arrayNumber + * @return arrayNumber **/ @ApiModelProperty(value = "") public List getArrayNumber() { return arrayNumber; } - public void setArrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -74,8 +75,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -97,5 +97,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..8b4867aebff 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 @@ -28,94 +28,97 @@ */ public class ArrayTest { + @JsonProperty("array_of_string") private List arrayOfString = null; - + @JsonProperty("array_array_of_integer") private List> arrayArrayOfInteger = null; - + @JsonProperty("array_array_of_model") private List> arrayArrayOfModel = null; - + public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; return this; } public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); + this.arrayOfString = new ArrayList<>(); } + this.arrayOfString.add(arrayOfStringItem); return this; } - - /** - * Get arrayOfString - * @return arrayOfString + + /** + * Get arrayOfString + * @return arrayOfString **/ @ApiModelProperty(value = "") public List getArrayOfString() { return arrayOfString; } - public void setArrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; } - + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; return this; } public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); + this.arrayArrayOfInteger = new ArrayList<>(); } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); return this; } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger **/ @ApiModelProperty(value = "") public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { this.arrayArrayOfInteger = arrayArrayOfInteger; } - + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; return this; } public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); + this.arrayArrayOfModel = new ArrayList<>(); } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); return this; } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel **/ @ApiModelProperty(value = "") public List> getArrayArrayOfModel() { return arrayArrayOfModel; } - public void setArrayArrayOfModel(List> arrayArrayOfModel) { this.arrayArrayOfModel = arrayArrayOfModel; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -134,8 +137,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -159,5 +161,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..f534657b4ca 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 @@ -25,133 +25,133 @@ */ public class Capitalization { + @JsonProperty("smallCamel") private String smallCamel = null; - + @JsonProperty("CapitalCamel") private String capitalCamel = null; - + @JsonProperty("small_Snake") private String smallSnake = null; - + @JsonProperty("Capital_Snake") private String capitalSnake = null; - + @JsonProperty("SCA_ETH_Flow_Points") private String scAETHFlowPoints = null; - + @JsonProperty("ATT_NAME") private String ATT_NAME = null; - + public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; return this; } - /** - * Get smallCamel - * @return smallCamel + + /** + * Get smallCamel + * @return smallCamel **/ @ApiModelProperty(value = "") public String getSmallCamel() { return smallCamel; } - public void setSmallCamel(String smallCamel) { this.smallCamel = smallCamel; } - + public Capitalization capitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; return this; } - /** - * Get capitalCamel - * @return capitalCamel + + /** + * Get capitalCamel + * @return capitalCamel **/ @ApiModelProperty(value = "") public String getCapitalCamel() { return capitalCamel; } - public void setCapitalCamel(String capitalCamel) { this.capitalCamel = capitalCamel; } - + public Capitalization smallSnake(String smallSnake) { this.smallSnake = smallSnake; return this; } - /** - * Get smallSnake - * @return smallSnake + + /** + * Get smallSnake + * @return smallSnake **/ @ApiModelProperty(value = "") public String getSmallSnake() { return smallSnake; } - public void setSmallSnake(String smallSnake) { this.smallSnake = smallSnake; } - + public Capitalization capitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; return this; } - /** - * Get capitalSnake - * @return capitalSnake + + /** + * Get capitalSnake + * @return capitalSnake **/ @ApiModelProperty(value = "") public String getCapitalSnake() { return capitalSnake; } - public void setCapitalSnake(String capitalSnake) { this.capitalSnake = capitalSnake; } - + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; return this; } - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints **/ @ApiModelProperty(value = "") public String getScAETHFlowPoints() { return scAETHFlowPoints; } - public void setScAETHFlowPoints(String scAETHFlowPoints) { this.scAETHFlowPoints = scAETHFlowPoints; } - + public Capitalization ATT_NAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; return this; } - /** - * Name of the pet - * @return ATT_NAME + + /** + * Name of the pet + * @return ATT_NAME **/ @ApiModelProperty(value = "Name of the pet ") public String getATTNAME() { return ATT_NAME; } - public void setATTNAME(String ATT_NAME) { this.ATT_NAME = ATT_NAME; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -173,8 +173,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -201,5 +200,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..d6e94912f06 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 @@ -26,28 +26,70 @@ */ public class Cat extends Animal { + + @JsonProperty("className") + private String className = null; + + @JsonProperty("color") + private String color = "red"; + @JsonProperty("declawed") private Boolean declawed = null; + + public Cat className(String className) { + this.className = className; + return this; + } + + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Cat color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Cat declawed(Boolean declawed) { this.declawed = declawed; return this; } - /** - * Get declawed - * @return declawed + + /** + * Get declawed + * @return declawed **/ @ApiModelProperty(value = "") public Boolean isDeclawed() { return declawed; } - public void setDeclawed(Boolean declawed) { this.declawed = declawed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -57,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && + return Objects.equals(this.className, cat.className) && + Objects.equals(this.color, cat.color) && + Objects.equals(this.declawed, cat.declawed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(declawed, super.hashCode()); + return Objects.hash(className, color, declawed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Cat {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); sb.append("}"); return sb.toString(); @@ -88,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..5ef89bf53cf 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 @@ -25,49 +25,49 @@ */ public class Category { + @JsonProperty("id") private Long id = null; - + @JsonProperty("name") private String name = null; - + public Category id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Category name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -85,8 +85,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -109,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..887733b7310 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 @@ -22,32 +22,31 @@ /** * Model for testing model with \"_class\" property - */ -@ApiModel(description = "Model for testing model with \"_class\" property") + */@ApiModel(description = "Model for testing model with \"_class\" property") public class ClassModel { + @JsonProperty("_class") private String propertyClass = null; - + public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,8 +63,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -87,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..6193700c6ca 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 @@ -25,28 +25,28 @@ */ public class Client { + @JsonProperty("client") private String client = null; - + public Client client(String client) { this.client = client; return this; } - /** - * Get client - * @return client + + /** + * Get client + * @return client **/ @ApiModelProperty(value = "") public String getClient() { return client; } - public void setClient(String client) { this.client = client; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -63,8 +63,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(client); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -86,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..bffa0917362 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 @@ -26,28 +26,70 @@ */ public class Dog extends Animal { + + @JsonProperty("className") + private String className = null; + + @JsonProperty("color") + private String color = "red"; + @JsonProperty("breed") private String breed = null; + + public Dog className(String className) { + this.className = className; + return this; + } + + + /** + * Get className + * @return className + **/ + @ApiModelProperty(required = true, value = "") + public String getClassName() { + return className; + } + public void setClassName(String className) { + this.className = className; + } + + public Dog color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + **/ + @ApiModelProperty(value = "") + public String getColor() { + return color; + } + public void setColor(String color) { + this.color = color; + } + public Dog breed(String breed) { this.breed = breed; return this; } - /** - * Get breed - * @return breed + + /** + * Get breed + * @return breed **/ @ApiModelProperty(value = "") public String getBreed() { return breed; } - public void setBreed(String breed) { this.breed = breed; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -57,21 +99,24 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && + return Objects.equals(this.className, dog.className) && + Objects.equals(this.color, dog.color) && + Objects.equals(this.breed, dog.breed) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(breed, super.hashCode()); + return Objects.hash(className, color, breed, super.hashCode()); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class Dog {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); sb.append("}"); return sb.toString(); @@ -88,5 +133,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..c46a90c300a 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 @@ -27,12 +27,13 @@ */ public class EnumArrays { - /** + + /** * Gets or Sets justSymbol */ public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), + GREATER_THAN_OR_EQUAL_TO(">="), DOLLAR("$"); private String value; @@ -40,8 +41,9 @@ public enum JustSymbolEnum { JustSymbolEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -50,8 +52,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static JustSymbolEnum fromValue(String text) { for (JustSymbolEnum b : JustSymbolEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -60,17 +63,20 @@ public static JustSymbolEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("just_symbol") private JustSymbolEnum justSymbol = null; - - /** + + + /** * Gets or Sets arrayEnum */ public enum ArrayEnumEnum { - FISH("fish"), + FISH("fish"), CRAB("crab"); private String value; @@ -78,8 +84,9 @@ public enum ArrayEnumEnum { ArrayEnumEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -88,8 +95,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static ArrayEnumEnum fromValue(String text) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -98,56 +106,57 @@ public static ArrayEnumEnum fromValue(String text) { } return null; } + } - + @JsonProperty("array_enum") private List arrayEnum = null; - + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; return this; } - /** - * Get justSymbol - * @return justSymbol + + /** + * Get justSymbol + * @return justSymbol **/ @ApiModelProperty(value = "") public JustSymbolEnum getJustSymbol() { return justSymbol; } - public void setJustSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; } - + public EnumArrays arrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; return this; } public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); + this.arrayEnum = new ArrayList<>(); } + this.arrayEnum.add(arrayEnumItem); return this; } - - /** - * Get arrayEnum - * @return arrayEnum + + /** + * Get arrayEnum + * @return arrayEnum **/ @ApiModelProperty(value = "") public List getArrayEnum() { return arrayEnum; } - public void setArrayEnum(List arrayEnum) { this.arrayEnum = arrayEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -165,8 +174,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -189,5 +197,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..9414211ef6c 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 @@ -13,14 +13,17 @@ package io.swagger.client.model; -import java.util.Objects; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + + /** * Gets or Sets EnumClass */ + public enum EnumClass { _ABC("_abc"), @@ -35,7 +38,9 @@ public enum EnumClass { this.value = value; } + @JsonValue + public String getValue() { return value; } @@ -45,7 +50,9 @@ public String toString() { return String.valueOf(value); } + @JsonCreator + public static EnumClass fromValue(String text) { for (EnumClass b : EnumClass.values()) { if (String.valueOf(b.value).equals(text)) { @@ -54,5 +61,8 @@ public static EnumClass fromValue(String text) { } return null; } + } + + 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..4634e7018db 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 @@ -26,14 +26,14 @@ */ public class EnumTest { - /** + + /** * Gets or Sets enumString */ public enum EnumStringEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"), - EMPTY(""); private String value; @@ -41,8 +41,9 @@ public enum EnumStringEnum { EnumStringEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -51,8 +52,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumStringEnum fromValue(String text) { for (EnumStringEnum b : EnumStringEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -61,17 +63,19 @@ public static EnumStringEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_string") private EnumStringEnum enumString = null; - - /** + + /** * Gets or Sets enumInteger */ public enum EnumIntegerEnum { - NUMBER_1(1), + NUMBER_1(1), NUMBER_MINUS_1(-1); private Integer value; @@ -79,8 +83,9 @@ public enum EnumIntegerEnum { EnumIntegerEnum(Integer value) { this.value = value; } - + @JsonValue + public Integer getValue() { return value; } @@ -89,8 +94,9 @@ public Integer getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumIntegerEnum fromValue(String text) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -99,17 +105,19 @@ public static EnumIntegerEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_integer") private EnumIntegerEnum enumInteger = null; - - /** + + /** * Gets or Sets enumNumber */ public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), + NUMBER_1_DOT_1(1.1), NUMBER_MINUS_1_DOT_2(-1.2); private Double value; @@ -117,8 +125,9 @@ public enum EnumNumberEnum { EnumNumberEnum(Double value) { this.value = value; } - + @JsonValue + public Double getValue() { return value; } @@ -127,8 +136,9 @@ public Double getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static EnumNumberEnum fromValue(String text) { for (EnumNumberEnum b : EnumNumberEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -137,87 +147,88 @@ public static EnumNumberEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("enum_number") private EnumNumberEnum enumNumber = null; - + @JsonProperty("outerEnum") private OuterEnum outerEnum = null; - + public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; return this; } - /** - * Get enumString - * @return enumString + + /** + * Get enumString + * @return enumString **/ @ApiModelProperty(value = "") public EnumStringEnum getEnumString() { return enumString; } - public void setEnumString(EnumStringEnum enumString) { this.enumString = enumString; } - + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; return this; } - /** - * Get enumInteger - * @return enumInteger + + /** + * Get enumInteger + * @return enumInteger **/ @ApiModelProperty(value = "") public EnumIntegerEnum getEnumInteger() { return enumInteger; } - public void setEnumInteger(EnumIntegerEnum enumInteger) { this.enumInteger = enumInteger; } - + public EnumTest enumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; return this; } - /** - * Get enumNumber - * @return enumNumber + + /** + * Get enumNumber + * @return enumNumber **/ @ApiModelProperty(value = "") public EnumNumberEnum getEnumNumber() { return enumNumber; } - public void setEnumNumber(EnumNumberEnum enumNumber) { this.enumNumber = enumNumber; } - + public EnumTest outerEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; return this; } - /** - * Get outerEnum - * @return outerEnum + + /** + * Get outerEnum + * @return outerEnum **/ @ApiModelProperty(value = "") public OuterEnum getOuterEnum() { return outerEnum; } - public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -237,8 +248,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(enumString, enumInteger, enumNumber, outerEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -263,5 +273,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\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..df02f3998d4 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 @@ -29,290 +29,284 @@ */ public class FormatTest { + @JsonProperty("integer") private Integer integer = null; - + @JsonProperty("int32") private Integer int32 = null; - + @JsonProperty("int64") private Long int64 = null; - + @JsonProperty("number") private BigDecimal number = null; - + @JsonProperty("float") private Float _float = null; - + @JsonProperty("double") private Double _double = null; - + @JsonProperty("string") private String string = null; - + @JsonProperty("byte") - private byte[] _byte = null; - + private String _byte = null; + @JsonProperty("binary") - private byte[] binary = null; - + private String binary = null; + @JsonProperty("date") private LocalDate date = null; - + @JsonProperty("dateTime") private OffsetDateTime dateTime = null; - + @JsonProperty("uuid") private UUID uuid = null; - + @JsonProperty("password") private String password = null; - + public FormatTest integer(Integer integer) { this.integer = integer; return this; } - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer **/ @ApiModelProperty(value = "") public Integer getInteger() { return integer; } - public void setInteger(Integer integer) { this.integer = integer; } - + public FormatTest int32(Integer int32) { this.int32 = int32; return this; } - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 **/ @ApiModelProperty(value = "") public Integer getInt32() { return int32; } - public void setInt32(Integer int32) { this.int32 = int32; } - + public FormatTest int64(Long int64) { this.int64 = int64; return this; } - /** - * Get int64 - * @return int64 + + /** + * Get int64 + * @return int64 **/ @ApiModelProperty(value = "") public Long getInt64() { return int64; } - public void setInt64(Long int64) { this.int64 = int64; } - + public FormatTest number(BigDecimal number) { this.number = number; return this; } - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number + + /** + * Get number + * @return number **/ @ApiModelProperty(required = true, value = "") public BigDecimal getNumber() { return number; } - public void setNumber(BigDecimal number) { this.number = number; } - + public FormatTest _float(Float _float) { this._float = _float; return this; } - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float + + /** + * Get _float + * @return _float **/ @ApiModelProperty(value = "") public Float getFloat() { return _float; } - public void setFloat(Float _float) { this._float = _float; } - + public FormatTest _double(Double _double) { this._double = _double; return this; } - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double + + /** + * Get _double + * @return _double **/ @ApiModelProperty(value = "") public Double getDouble() { return _double; } - public void setDouble(Double _double) { this._double = _double; } - + public FormatTest string(String string) { this.string = string; return this; } - /** - * Get string - * @return string + + /** + * Get string + * @return string **/ @ApiModelProperty(value = "") public String getString() { return string; } - public void setString(String string) { this.string = string; } - - public FormatTest _byte(byte[] _byte) { + + public FormatTest _byte(String _byte) { this._byte = _byte; return this; } - /** - * Get _byte - * @return _byte + + /** + * Get _byte + * @return _byte **/ @ApiModelProperty(required = true, value = "") - public byte[] getByte() { + public String getByte() { return _byte; } - - public void setByte(byte[] _byte) { + public void setByte(String _byte) { this._byte = _byte; } - - public FormatTest binary(byte[] binary) { + + public FormatTest binary(String binary) { this.binary = binary; return this; } - /** - * Get binary - * @return binary + + /** + * Get binary + * @return binary **/ @ApiModelProperty(value = "") - public byte[] getBinary() { + public String getBinary() { return binary; } - - public void setBinary(byte[] binary) { + public void setBinary(String binary) { this.binary = binary; } - + public FormatTest date(LocalDate date) { this.date = date; return this; } - /** - * Get date - * @return date + + /** + * Get date + * @return date **/ @ApiModelProperty(required = true, value = "") public LocalDate getDate() { return date; } - public void setDate(LocalDate date) { this.date = date; } - + public FormatTest dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public FormatTest uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public FormatTest password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(required = true, value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -341,8 +335,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -376,5 +369,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..98a721fb9dc 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 @@ -25,31 +25,33 @@ */ public class HasOnlyReadOnly { + @JsonProperty("bar") private String bar = null; - + @JsonProperty("foo") private String foo = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - - /** - * Get foo - * @return foo + + + /** + * Get foo + * @return foo **/ @ApiModelProperty(value = "") public String getFoo() { return foo; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -67,8 +69,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, foo); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -91,5 +92,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..cc0556cfb88 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 @@ -28,15 +28,17 @@ */ public class MapTest { + @JsonProperty("map_map_of_string") private Map> mapMapOfString = null; - - /** + + + /** * Gets or Sets inner */ public enum InnerEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"); private String value; @@ -44,8 +46,9 @@ public enum InnerEnum { InnerEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -54,8 +57,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static InnerEnum fromValue(String text) { for (InnerEnum b : InnerEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -64,64 +68,64 @@ public static InnerEnum fromValue(String text) { } return null; } + } - + @JsonProperty("map_of_enum_string") private Map mapOfEnumString = null; - + public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; return this; } 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; } - - /** - * Get mapMapOfString - * @return mapMapOfString + /** + * Get mapMapOfString + * @return mapMapOfString **/ @ApiModelProperty(value = "") public Map> getMapMapOfString() { return mapMapOfString; } - public void setMapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; } - + public MapTest mapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; return this; } public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); + this.mapOfEnumString = new HashMap<>(); } + this.mapOfEnumString.put(key, mapOfEnumStringItem); return this; } - - /** - * Get mapOfEnumString - * @return mapOfEnumString + /** + * Get mapOfEnumString + * @return mapOfEnumString **/ @ApiModelProperty(value = "") public Map getMapOfEnumString() { return mapOfEnumString; } - public void setMapOfEnumString(Map mapOfEnumString) { this.mapOfEnumString = mapOfEnumString; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -139,8 +143,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -163,5 +166,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..85e25e354ee 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 @@ -31,78 +31,78 @@ */ public class MixedPropertiesAndAdditionalPropertiesClass { + @JsonProperty("uuid") private UUID uuid = null; - + @JsonProperty("dateTime") private OffsetDateTime dateTime = null; - + @JsonProperty("map") private Map map = null; - + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; return this; } - /** - * Get uuid - * @return uuid + + /** + * Get uuid + * @return uuid **/ @ApiModelProperty(value = "") public UUID getUuid() { return uuid; } - public void setUuid(UUID uuid) { this.uuid = uuid; } - + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; return this; } - /** - * Get dateTime - * @return dateTime + + /** + * Get dateTime + * @return dateTime **/ @ApiModelProperty(value = "") public OffsetDateTime getDateTime() { return dateTime; } - public void setDateTime(OffsetDateTime dateTime) { this.dateTime = dateTime; } - + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { this.map = map; return this; } 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; } - - /** - * Get map - * @return map + /** + * Get map + * @return map **/ @ApiModelProperty(value = "") public Map getMap() { return map; } - public void setMap(Map map) { this.map = map; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -121,8 +121,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(uuid, dateTime, map); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -146,5 +145,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..606b051c2ea 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 @@ -22,53 +22,52 @@ /** * Model for testing model name starting with number - */ -@ApiModel(description = "Model for testing model name starting with number") + */@ApiModel(description = "Model for testing model name starting with number") public class Model200Response { + @JsonProperty("name") private Integer name = null; - + @JsonProperty("class") private String propertyClass = null; - + public Model200Response name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - + public Model200Response propertyClass(String propertyClass) { this.propertyClass = propertyClass; return this; } - /** - * Get propertyClass - * @return propertyClass + + /** + * Get propertyClass + * @return propertyClass **/ @ApiModelProperty(value = "") public String getPropertyClass() { return propertyClass; } - public void setPropertyClass(String propertyClass) { this.propertyClass = propertyClass; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -86,8 +85,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -110,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..4002f3f632e 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 @@ -25,70 +25,70 @@ */ public class ModelApiResponse { + @JsonProperty("code") private Integer code = null; - + @JsonProperty("type") private String type = null; - + @JsonProperty("message") private String message = null; - + public ModelApiResponse code(Integer code) { this.code = code; return this; } - /** - * Get code - * @return code + + /** + * Get code + * @return code **/ @ApiModelProperty(value = "") public Integer getCode() { return code; } - public void setCode(Integer code) { this.code = code; } - + public ModelApiResponse type(String type) { this.type = type; return this; } - /** - * Get type - * @return type + + /** + * Get type + * @return type **/ @ApiModelProperty(value = "") public String getType() { return type; } - public void setType(String type) { this.type = type; } - + public ModelApiResponse message(String message) { this.message = message; return this; } - /** - * Get message - * @return message + + /** + * Get message + * @return message **/ @ApiModelProperty(value = "") public String getMessage() { return message; } - public void setMessage(String message) { this.message = message; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -107,8 +107,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(code, type, message); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -132,5 +131,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..685e5ba93ac 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 @@ -22,32 +22,31 @@ /** * Model for testing reserved words - */ -@ApiModel(description = "Model for testing reserved words") + */@ApiModel(description = "Model for testing reserved words") public class ModelReturn { + @JsonProperty("return") private Integer _return = null; - + public ModelReturn _return(Integer _return) { this._return = _return; return this; } - /** - * Get _return - * @return _return + + /** + * Get _return + * @return _return **/ @ApiModelProperty(value = "") public Integer getReturn() { return _return; } - public void setReturn(Integer _return) { this._return = _return; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,8 +63,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(_return); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -87,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..7c94ab233c2 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 @@ -22,77 +22,78 @@ /** * Model for testing model name same as property name - */ -@ApiModel(description = "Model for testing model name same as property name") + */@ApiModel(description = "Model for testing model name same as property name") public class Name { + @JsonProperty("name") private Integer name = null; - + @JsonProperty("snake_case") private Integer snakeCase = null; - + @JsonProperty("property") private String property = null; - + @JsonProperty("123Number") private Integer _123Number = null; - + public Name name(Integer name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(required = true, value = "") public Integer getName() { return name; } - public void setName(Integer name) { this.name = name; } - - /** - * Get snakeCase - * @return snakeCase + + + /** + * Get snakeCase + * @return snakeCase **/ @ApiModelProperty(value = "") public Integer getSnakeCase() { return snakeCase; } - + public Name property(String property) { this.property = property; return this; } - /** - * Get property - * @return property + + /** + * Get property + * @return property **/ @ApiModelProperty(value = "") public String getProperty() { return property; } - public void setProperty(String property) { this.property = property; } - - /** - * Get _123Number - * @return _123Number + + + /** + * Get _123Number + * @return _123Number **/ @ApiModelProperty(value = "") public Integer get123Number() { return _123Number; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -112,8 +113,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, snakeCase, property, _123Number); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -138,5 +138,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..dc53f9e50dc 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 @@ -26,28 +26,28 @@ */ public class NumberOnly { + @JsonProperty("JustNumber") private BigDecimal justNumber = null; - + public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; return this; } - /** - * Get justNumber - * @return justNumber + + /** + * Get justNumber + * @return justNumber **/ @ApiModelProperty(value = "") public BigDecimal getJustNumber() { return justNumber; } - public void setJustNumber(BigDecimal justNumber) { this.justNumber = justNumber; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -64,8 +64,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -87,5 +86,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..0a6d7ad0933 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 @@ -26,26 +26,26 @@ */ public class Order { + @JsonProperty("id") private Long id = null; - + @JsonProperty("petId") private Long petId = null; - + @JsonProperty("quantity") private Integer quantity = null; - + @JsonProperty("shipDate") private OffsetDateTime shipDate = null; - - /** + + /** * Order Status */ public enum StatusEnum { - PLACED("placed"), + PLACED("placed"), APPROVED("approved"), - DELIVERED("delivered"); private String value; @@ -53,8 +53,9 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -63,8 +64,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -73,123 +75,124 @@ public static StatusEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("status") private StatusEnum status = null; - + @JsonProperty("complete") private Boolean complete = false; - + public Order id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Order petId(Long petId) { this.petId = petId; return this; } - /** - * Get petId - * @return petId + + /** + * Get petId + * @return petId **/ @ApiModelProperty(value = "") public Long getPetId() { return petId; } - public void setPetId(Long petId) { this.petId = petId; } - + public Order quantity(Integer quantity) { this.quantity = quantity; return this; } - /** - * Get quantity - * @return quantity + + /** + * Get quantity + * @return quantity **/ @ApiModelProperty(value = "") public Integer getQuantity() { return quantity; } - public void setQuantity(Integer quantity) { this.quantity = quantity; } - + public Order shipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; return this; } - /** - * Get shipDate - * @return shipDate + + /** + * Get shipDate + * @return shipDate **/ @ApiModelProperty(value = "") public OffsetDateTime getShipDate() { return shipDate; } - public void setShipDate(OffsetDateTime shipDate) { this.shipDate = shipDate; } - + public Order status(StatusEnum status) { this.status = status; return this; } - /** - * Order Status - * @return status + + /** + * Order Status + * @return status **/ @ApiModelProperty(value = "Order Status") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - + public Order complete(Boolean complete) { this.complete = complete; return this; } - /** - * Get complete - * @return complete + + /** + * Get complete + * @return complete **/ @ApiModelProperty(value = "") public Boolean isComplete() { return complete; } - public void setComplete(Boolean complete) { this.complete = complete; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -211,8 +214,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, petId, quantity, shipDate, status, complete); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -239,5 +241,8 @@ private String toIndentedString(java.lang.Object o) { 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..8b957f45a14 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 @@ -26,70 +26,70 @@ */ public class OuterComposite { + @JsonProperty("my_number") private BigDecimal myNumber = null; - + @JsonProperty("my_string") private String myString = null; - + @JsonProperty("my_boolean") private Boolean myBoolean = null; - + public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; return this; } - /** - * Get myNumber - * @return myNumber + + /** + * Get myNumber + * @return myNumber **/ @ApiModelProperty(value = "") public BigDecimal getMyNumber() { return myNumber; } - public void setMyNumber(BigDecimal myNumber) { this.myNumber = myNumber; } - + public OuterComposite myString(String myString) { this.myString = myString; return this; } - /** - * Get myString - * @return myString + + /** + * Get myString + * @return myString **/ @ApiModelProperty(value = "") public String getMyString() { return myString; } - public void setMyString(String myString) { this.myString = myString; } - + public OuterComposite myBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; return this; } - /** - * Get myBoolean - * @return myBoolean + + /** + * Get myBoolean + * @return myBoolean **/ @ApiModelProperty(value = "") public Boolean getMyBoolean() { return myBoolean; } - public void setMyBoolean(Boolean myBoolean) { this.myBoolean = myBoolean; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -108,8 +108,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(myNumber, myString, myBoolean); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -133,5 +132,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..3390d473c7b 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 @@ -13,14 +13,17 @@ package io.swagger.client.model; -import java.util.Objects; + import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; + + /** * Gets or Sets OuterEnum */ + public enum OuterEnum { PLACED("placed"), @@ -35,7 +38,9 @@ public enum OuterEnum { this.value = value; } + @JsonValue + public String getValue() { return value; } @@ -45,7 +50,9 @@ public String toString() { return String.valueOf(value); } + @JsonCreator + public static OuterEnum fromValue(String text) { for (OuterEnum b : OuterEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -54,5 +61,8 @@ public static OuterEnum fromValue(String text) { } return null; } + } + + 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..2bda9b34787 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 @@ -29,29 +29,29 @@ */ public class Pet { + @JsonProperty("id") private Long id = null; - + @JsonProperty("category") private Category category = null; - + @JsonProperty("name") private String name = null; - + @JsonProperty("photoUrls") - private List photoUrls = new ArrayList(); - + private List photoUrls = new ArrayList<>(); + @JsonProperty("tags") private List tags = null; - - /** + + /** * pet status in the store */ public enum StatusEnum { - AVAILABLE("available"), + AVAILABLE("available"), PENDING("pending"), - SOLD("sold"); private String value; @@ -59,8 +59,9 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + @JsonValue + public String getValue() { return value; } @@ -69,8 +70,9 @@ public String getValue() { public String toString() { return String.valueOf(value); } - + @JsonCreator + public static StatusEnum fromValue(String text) { for (StatusEnum b : StatusEnum.values()) { if (String.valueOf(b.value).equals(text)) { @@ -79,133 +81,135 @@ public static StatusEnum fromValue(String text) { } return null; } + } - + + @JsonProperty("status") private StatusEnum status = null; - + public Pet id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Pet category(Category category) { this.category = category; return this; } - /** - * Get category - * @return category + + /** + * Get category + * @return category **/ @ApiModelProperty(value = "") public Category getCategory() { return category; } - public void setCategory(Category category) { this.category = category; } - + public Pet name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(example = "doggie", required = true, value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - + public Pet photoUrls(List photoUrls) { this.photoUrls = photoUrls; return this; } public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); return this; } - - /** - * Get photoUrls - * @return photoUrls + + /** + * Get photoUrls + * @return photoUrls **/ @ApiModelProperty(required = true, value = "") public List getPhotoUrls() { return photoUrls; } - public void setPhotoUrls(List photoUrls) { this.photoUrls = photoUrls; } - + public Pet tags(List tags) { this.tags = tags; return this; } public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { - this.tags = new ArrayList(); + this.tags = new ArrayList<>(); } + this.tags.add(tagsItem); return this; } - - /** - * Get tags - * @return tags + + /** + * Get tags + * @return tags **/ @ApiModelProperty(value = "") public List getTags() { return tags; } - public void setTags(List tags) { this.tags = tags; } - + public Pet status(StatusEnum status) { this.status = status; return this; } - /** - * pet status in the store - * @return status + + /** + * pet status in the store + * @return status **/ @ApiModelProperty(value = "pet status in the store") public StatusEnum getStatus() { return status; } - public void setStatus(StatusEnum status) { this.status = status; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -227,8 +231,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, category, name, photoUrls, tags, status); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -255,5 +258,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..1532a30b9e9 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 @@ -25,40 +25,41 @@ */ public class ReadOnlyFirst { + @JsonProperty("bar") private String bar = null; - + @JsonProperty("baz") private String baz = null; - - /** - * Get bar - * @return bar + + + /** + * Get bar + * @return bar **/ @ApiModelProperty(value = "") public String getBar() { return bar; } - + public ReadOnlyFirst baz(String baz) { this.baz = baz; return this; } - /** - * Get baz - * @return baz + + /** + * Get baz + * @return baz **/ @ApiModelProperty(value = "") public String getBaz() { return baz; } - public void setBaz(String baz) { this.baz = baz; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -76,8 +77,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, baz); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,5 +100,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..38b54fd6c38 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 @@ -25,28 +25,28 @@ */ public class SpecialModelName { - @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; + @JsonProperty("$special[property.name]") + private Long $specialPropertyName = null; + + 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; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -55,22 +55,21 @@ public boolean equals(java.lang.Object o) { 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); } - - + @Override public String toString() { 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(); } @@ -86,5 +85,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..2967322b174 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 @@ -25,49 +25,49 @@ */ public class Tag { + @JsonProperty("id") private Long id = null; - + @JsonProperty("name") private String name = null; - + public Tag id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public Tag name(String name) { this.name = name; return this; } - /** - * Get name - * @return name + + /** + * Get name + * @return name **/ @ApiModelProperty(value = "") public String getName() { return name; } - public void setName(String name) { this.name = name; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -85,8 +85,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -109,5 +108,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..cb2f9f34084 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 @@ -25,175 +25,175 @@ */ public class User { + @JsonProperty("id") private Long id = null; - + @JsonProperty("username") private String username = null; - + @JsonProperty("firstName") private String firstName = null; - + @JsonProperty("lastName") private String lastName = null; - + @JsonProperty("email") private String email = null; - + @JsonProperty("password") private String password = null; - + @JsonProperty("phone") private String phone = null; - + @JsonProperty("userStatus") private Integer userStatus = null; - + public User id(Long id) { this.id = id; return this; } - /** - * Get id - * @return id + + /** + * Get id + * @return id **/ @ApiModelProperty(value = "") public Long getId() { return id; } - public void setId(Long id) { this.id = id; } - + public User username(String username) { this.username = username; return this; } - /** - * Get username - * @return username + + /** + * Get username + * @return username **/ @ApiModelProperty(value = "") public String getUsername() { return username; } - public void setUsername(String username) { this.username = username; } - + public User firstName(String firstName) { this.firstName = firstName; return this; } - /** - * Get firstName - * @return firstName + + /** + * Get firstName + * @return firstName **/ @ApiModelProperty(value = "") public String getFirstName() { return firstName; } - public void setFirstName(String firstName) { this.firstName = firstName; } - + public User lastName(String lastName) { this.lastName = lastName; return this; } - /** - * Get lastName - * @return lastName + + /** + * Get lastName + * @return lastName **/ @ApiModelProperty(value = "") public String getLastName() { return lastName; } - public void setLastName(String lastName) { this.lastName = lastName; } - + public User email(String email) { this.email = email; return this; } - /** - * Get email - * @return email + + /** + * Get email + * @return email **/ @ApiModelProperty(value = "") public String getEmail() { return email; } - public void setEmail(String email) { this.email = email; } - + public User password(String password) { this.password = password; return this; } - /** - * Get password - * @return password + + /** + * Get password + * @return password **/ @ApiModelProperty(value = "") public String getPassword() { return password; } - public void setPassword(String password) { this.password = password; } - + public User phone(String phone) { this.phone = phone; return this; } - /** - * Get phone - * @return phone + + /** + * Get phone + * @return phone **/ @ApiModelProperty(value = "") public String getPhone() { return phone; } - public void setPhone(String phone) { this.phone = phone; } - + public User userStatus(Integer userStatus) { this.userStatus = userStatus; return this; } - /** - * User Status - * @return userStatus + + /** + * User Status + * @return userStatus **/ @ApiModelProperty(value = "User Status") public Integer getUserStatus() { return userStatus; } - public void setUserStatus(Integer userStatus) { this.userStatus = userStatus; } - - + @Override public boolean equals(java.lang.Object o) { if (this == o) { @@ -217,8 +217,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -247,5 +246,8 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + } + + 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..eb55203bffd --- /dev/null +++ b/samples/client/petstore/java/vertx/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -0,0 +1,81 @@ +/* + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.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..015a995b69c 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 @@ -14,10 +14,9 @@ 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.Configuration; import org.junit.Test; @@ -35,11 +34,13 @@ 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 FakeApi */ @@ -70,7 +71,9 @@ public void setupApiClient() { @Test public void fakeOuterBooleanSerializeTest(TestContext context) { Async async = context.async(); + Boolean body = null; + api.fakeOuterBooleanSerialize(body, result -> { // TODO: test validations async.complete(); @@ -86,8 +89,10 @@ public void fakeOuterBooleanSerializeTest(TestContext context) { @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(); }); @@ -102,7 +107,9 @@ public void fakeOuterCompositeSerializeTest(TestContext context) { @Test public void fakeOuterNumberSerializeTest(TestContext context) { Async async = context.async(); + BigDecimal body = null; + api.fakeOuterNumberSerialize(body, result -> { // TODO: test validations async.complete(); @@ -118,7 +125,9 @@ public void fakeOuterNumberSerializeTest(TestContext context) { @Test public void fakeOuterStringSerializeTest(TestContext context) { Async async = context.async(); + String body = null; + api.fakeOuterStringSerialize(body, result -> { // TODO: test validations async.complete(); @@ -134,8 +143,10 @@ public void fakeOuterStringSerializeTest(TestContext context) { @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(); }); @@ -150,21 +161,10 @@ public void testClientModelTest(TestContext context) { @Test public void testEndpointParametersTest(TestContext context) { Async async = context.async(); - BigDecimal number = null; - Double _double = null; - String patternWithoutDelimiter = null; - byte[] _byte = null; - Integer integer = null; - Integer int32 = null; - Long int64 = null; - Float _float = null; - String string = null; - byte[] binary = null; - LocalDate date = null; - OffsetDateTime dateTime = null; - String password = null; - String paramCallback = null; - api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, result -> { + + Object body = null; + + api.testEndpointParameters(body, result -> { // TODO: test validations async.complete(); }); @@ -179,15 +179,38 @@ public void testEndpointParametersTest(TestContext context) { @Test public void testEnumParametersTest(TestContext context) { Async async = context.async(); - List enumFormStringArray = null; - String enumFormString = null; + + Object body = 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 -> { + + api.testEnumParameters(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, 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(); + + Map body = null; + + api.testInlineAdditionalProperties(body, result -> { // TODO: test validations async.complete(); }); @@ -202,9 +225,10 @@ public void testEnumParametersTest(TestContext context) { @Test public void testJsonFormDataTest(TestContext context) { Async async = context.async(); - String param = null; - String param2 = null; - api.testJsonFormData(param, param2, result -> { + + Object body = null; + + api.testJsonFormData(body, 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..cc661d02db8 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 @@ -14,6 +14,7 @@ import io.swagger.client.model.Client; + import io.swagger.client.Configuration; import org.junit.Test; @@ -31,11 +32,13 @@ 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 FakeClassnameTags123Api */ @@ -66,8 +69,10 @@ public void setupApiClient() { @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..1b50d0d15b4 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 @@ -12,10 +12,10 @@ package io.swagger.client.api; -import io.vertx.core.file.AsyncFile; import io.swagger.client.model.ModelApiResponse; import io.swagger.client.model.Pet; + import io.swagger.client.Configuration; import org.junit.Test; @@ -33,11 +33,13 @@ 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 PetApi */ @@ -68,8 +70,10 @@ public void setupApiClient() { @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(); }); @@ -84,8 +88,11 @@ public void addPetTest(TestContext context) { @Test public void deletePetTest(TestContext context) { Async async = context.async(); - Long petId = null; + + Integer petId = null; + String apiKey = null; + api.deletePet(petId, apiKey, result -> { // TODO: test validations async.complete(); @@ -101,7 +108,9 @@ public void deletePetTest(TestContext context) { @Test public void findPetsByStatusTest(TestContext context) { Async async = context.async(); + List status = null; + api.findPetsByStatus(status, result -> { // TODO: test validations async.complete(); @@ -117,7 +126,9 @@ public void findPetsByStatusTest(TestContext context) { @Test public void findPetsByTagsTest(TestContext context) { Async async = context.async(); + List tags = null; + api.findPetsByTags(tags, result -> { // TODO: test validations async.complete(); @@ -133,7 +144,9 @@ public void findPetsByTagsTest(TestContext context) { @Test public void getPetByIdTest(TestContext context) { Async async = context.async(); - Long petId = null; + + Integer petId = null; + api.getPetById(petId, result -> { // TODO: test validations async.complete(); @@ -149,8 +162,10 @@ public void getPetByIdTest(TestContext context) { @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(); }); @@ -165,10 +180,12 @@ public void updatePetTest(TestContext context) { @Test public void updatePetWithFormTest(TestContext context) { Async async = context.async(); - Long petId = null; - String name = null; - String status = null; - api.updatePetWithForm(petId, name, status, result -> { + + Integer petId = null; + + Object body = null; + + api.updatePetWithForm(petId, body, result -> { // TODO: test validations async.complete(); }); @@ -183,10 +200,12 @@ public void updatePetWithFormTest(TestContext context) { @Test public void uploadFileTest(TestContext context) { Async async = context.async(); - Long petId = null; - String additionalMetadata = null; - AsyncFile file = null; - api.uploadFile(petId, additionalMetadata, file, result -> { + + Integer petId = null; + + Object body = null; + + api.uploadFile(petId, body, 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..e56f0cab9a2 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 @@ -14,6 +14,7 @@ import io.swagger.client.model.Order; + import io.swagger.client.Configuration; import org.junit.Test; @@ -31,11 +32,13 @@ 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 StoreApi */ @@ -66,7 +69,9 @@ public void setupApiClient() { @Test public void deleteOrderTest(TestContext context) { Async async = context.async(); + String orderId = null; + api.deleteOrder(orderId, result -> { // TODO: test validations async.complete(); @@ -82,6 +87,7 @@ public void deleteOrderTest(TestContext context) { @Test public void getInventoryTest(TestContext context) { Async async = context.async(); + api.getInventory(result -> { // TODO: test validations async.complete(); @@ -97,7 +103,9 @@ public void getInventoryTest(TestContext context) { @Test public void getOrderByIdTest(TestContext context) { Async async = context.async(); - Long orderId = null; + + Integer orderId = null; + api.getOrderById(orderId, result -> { // TODO: test validations async.complete(); @@ -113,8 +121,10 @@ public void getOrderByIdTest(TestContext context) { @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..af3b8c310d5 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 @@ -14,6 +14,7 @@ import io.swagger.client.model.User; + import io.swagger.client.Configuration; import org.junit.Test; @@ -31,11 +32,13 @@ 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 UserApi */ @@ -66,8 +69,10 @@ public void setupApiClient() { @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,7 +87,9 @@ public void createUserTest(TestContext context) { @Test public void createUsersWithArrayInputTest(TestContext context) { Async async = context.async(); + List body = null; + api.createUsersWithArrayInput(body, result -> { // TODO: test validations async.complete(); @@ -98,7 +105,9 @@ public void createUsersWithArrayInputTest(TestContext context) { @Test public void createUsersWithListInputTest(TestContext context) { Async async = context.async(); + List body = null; + api.createUsersWithListInput(body, result -> { // TODO: test validations async.complete(); @@ -114,7 +123,9 @@ public void createUsersWithListInputTest(TestContext context) { @Test public void deleteUserTest(TestContext context) { Async async = context.async(); + String username = null; + api.deleteUser(username, result -> { // TODO: test validations async.complete(); @@ -130,7 +141,9 @@ public void deleteUserTest(TestContext context) { @Test public void getUserByNameTest(TestContext context) { Async async = context.async(); + String username = null; + api.getUserByName(username, result -> { // TODO: test validations async.complete(); @@ -146,8 +159,11 @@ public void getUserByNameTest(TestContext context) { @Test public void loginUserTest(TestContext context) { Async async = context.async(); + String username = null; + String password = null; + api.loginUser(username, password, result -> { // TODO: test validations async.complete(); @@ -163,6 +179,7 @@ public void loginUserTest(TestContext context) { @Test public void logoutUserTest(TestContext context) { Async async = context.async(); + api.logoutUser(result -> { // TODO: test validations async.complete(); @@ -178,9 +195,12 @@ public void logoutUserTest(TestContext context) { @Test public void updateUserTest(TestContext context) { Async async = context.async(); + + User user = null; + String username = null; - User body = null; - api.updateUser(username, body, result -> { + + api.updateUser(user, username, result -> { // TODO: test validations async.complete(); });