diff --git a/bin/java-petstore-jersey2-java6.sh b/bin/java-petstore-jersey2-java6.sh index 3ce176f263e..8ab7c2c7ef4 100755 --- a/bin/java-petstore-jersey2-java6.sh +++ b/bin/java-petstore-jersey2-java6.sh @@ -31,5 +31,4 @@ 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 {} + -# 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 +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 53fafacf06c..284f2e06fbc 100755 --- a/bin/java-petstore-okhttp-gson-parcelable.sh +++ b/bin/java-petstore-okhttp-gson-parcelable.sh @@ -30,5 +30,4 @@ ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with 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 {} + -# 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 +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-okhttp-gson.sh b/bin/java-petstore-okhttp-gson.sh index 48808cf7223..492cd5ff4a4 100755 --- a/bin/java-petstore-okhttp-gson.sh +++ b/bin/java-petstore-okhttp-gson.sh @@ -30,5 +30,4 @@ ags="$@ generate -i modules/swagger-codegen/src/test/resources/2_0/petstore-with 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 {} + -# 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 +java $JAVA_OPTS -jar $executable $ags diff --git a/samples/client/petstore/java/jersey2-java6/.swagger-codegen/VERSION b/samples/client/petstore/java/jersey2-java6/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/client/petstore/java/jersey2-java6/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/jersey2-java6/.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-java6/README.md b/samples/client/petstore/java/jersey2-java6/README.md index b53485ad7d9..20cfa47a516 100644 --- a/samples/client/petstore/java/jersey2-java6/README.md +++ b/samples/client/petstore/java/jersey2-java6/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-java6/build.gradle b/samples/client/petstore/java/jersey2-java6/build.gradle index c64dc492c46..1fdde25b53c 100644 --- a/samples/client/petstore/java/jersey2-java6/build.gradle +++ b/samples/client/petstore/java/jersey2-java6/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 { @@ -95,9 +101,11 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.15" jackson_version = "2.8.9" - jersey_version = "2.6" + jersey_version = "2.25.1" + commons_io_version=2.5 commons_lang3_version=3.6 + junit_version = "4.12" } @@ -109,9 +117,17 @@ 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 "commons-io:commons-io:$commons_io_version" compile "org.apache.commons:commons-lang3:$commons_lang3_version" + + compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_version", + + compile "com.brsanthu:migbase64:2.2" + testCompile "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/jersey2-java6/build.sbt b/samples/client/petstore/java/jersey2-java6/build.sbt index eecfab7a984..d06452d0ff8 100644 --- a/samples/client/petstore/java/jersey2-java6/build.sbt +++ b/samples/client/petstore/java/jersey2-java6/build.sbt @@ -10,16 +10,24 @@ lazy val root = (project in file(".")). resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( "io.swagger" % "swagger-annotations" % "1.5.15", - "org.glassfish.jersey.core" % "jersey-client" % "2.6", - "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.6", - "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.6", + "org.glassfish.jersey.core" % "jersey-client" % "2.25.1", + "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.25.1", + "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.25.1", "com.fasterxml.jackson.core" % "jackson-core" % "2.6.4" % "compile", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.6.4" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.6.4" % "compile", + + + "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.6.4" % "compile", + + "com.brsanthu" % "migbase64" % "2.2", + + "org.apache.commons" % "commons-lang3" % "3.6", "commons-io" % "commons-io" % "2.5", + "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) diff --git a/samples/client/petstore/java/jersey2-java6/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/jersey2-java6/docs/AdditionalPropertiesClass.md index 0437c4dd8cc..b37862da7cf 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/java/jersey2-java6/docs/AdditionalPropertiesClass.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java6/docs/Animal.md b/samples/client/petstore/java/jersey2-java6/docs/Animal.md index b3f325c3524..346caaf63f4 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/Animal.md +++ b/samples/client/petstore/java/jersey2-java6/docs/Animal.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java6/docs/AnimalFarm.md b/samples/client/petstore/java/jersey2-java6/docs/AnimalFarm.md deleted file mode 100644 index c7c7f1ddcce..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ - -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md index 7a04619aaba..fb5c988e6cc 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/jersey2-java6/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-java6/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/jersey2-java6/docs/ArrayOfArrayOfNumberOnly.md index 77292549927..3671a5e9190 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/java/jersey2-java6/docs/ArrayOfArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java6/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/jersey2-java6/docs/ArrayOfNumberOnly.md index e8cc4cd36dc..30b9b6648f4 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/java/jersey2-java6/docs/ArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java6/docs/ArrayTest.md b/samples/client/petstore/java/jersey2-java6/docs/ArrayTest.md index 9feee16427f..4ab76343030 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/ArrayTest.md +++ b/samples/client/petstore/java/jersey2-java6/docs/ArrayTest.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java6/docs/Capitalization.md b/samples/client/petstore/java/jersey2-java6/docs/Capitalization.md index 0f3064c1996..9af7864f97e 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/Capitalization.md +++ b/samples/client/petstore/java/jersey2-java6/docs/Capitalization.md @@ -13,3 +13,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java6/docs/Cat.md b/samples/client/petstore/java/jersey2-java6/docs/Cat.md index 6e9f71ce7dd..5e408344021 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/Cat.md +++ b/samples/client/petstore/java/jersey2-java6/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-java6/docs/Category.md b/samples/client/petstore/java/jersey2-java6/docs/Category.md index e2df0803278..deb5a3e2a52 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/Category.md +++ b/samples/client/petstore/java/jersey2-java6/docs/Category.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java6/docs/ClassModel.md b/samples/client/petstore/java/jersey2-java6/docs/ClassModel.md index 64f880c8786..49c281cc0ed 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/ClassModel.md +++ b/samples/client/petstore/java/jersey2-java6/docs/ClassModel.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java6/docs/Client.md b/samples/client/petstore/java/jersey2-java6/docs/Client.md index 5c490ea166c..52b2f72c79c 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/Client.md +++ b/samples/client/petstore/java/jersey2-java6/docs/Client.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java6/docs/Dog.md b/samples/client/petstore/java/jersey2-java6/docs/Dog.md index ac7cea323ff..00e6446e9f5 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/Dog.md +++ b/samples/client/petstore/java/jersey2-java6/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-java6/docs/EnumArrays.md b/samples/client/petstore/java/jersey2-java6/docs/EnumArrays.md index 4dddc0bfd27..939a0e69587 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/EnumArrays.md +++ b/samples/client/petstore/java/jersey2-java6/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-java6/docs/EnumTest.md b/samples/client/petstore/java/jersey2-java6/docs/EnumTest.md index 08fee344882..9722c621962 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/EnumTest.md +++ b/samples/client/petstore/java/jersey2-java6/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-java6/docs/FakeApi.md b/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md index 737ccc28293..6690b870e4e 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md +++ b/samples/client/petstore/java/jersey2-java6/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-java6/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/jersey2-java6/docs/FakeClassnameTags123Api.md index bc728bfce5b..2bcbbb7908f 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/jersey2-java6/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-java6/docs/FormatTest.md b/samples/client/petstore/java/jersey2-java6/docs/FormatTest.md index c7a3acb3cb7..bc11b93cb26 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/FormatTest.md +++ b/samples/client/petstore/java/jersey2-java6/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-java6/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/jersey2-java6/docs/HasOnlyReadOnly.md index c1d0aac5672..5564ddcf28a 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/java/jersey2-java6/docs/HasOnlyReadOnly.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java6/docs/MapTest.md b/samples/client/petstore/java/jersey2-java6/docs/MapTest.md index 714a97a40d9..74a6fe8ae70 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/MapTest.md +++ b/samples/client/petstore/java/jersey2-java6/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-java6/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/jersey2-java6/docs/MixedPropertiesAndAdditionalPropertiesClass.md index b12e2cd70e6..4507481b5a9 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/jersey2-java6/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java6/docs/Model200Response.md b/samples/client/petstore/java/jersey2-java6/docs/Model200Response.md index 5b3a9a0e46d..8d2cc50bb83 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/Model200Response.md +++ b/samples/client/petstore/java/jersey2-java6/docs/Model200Response.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java6/docs/ModelApiResponse.md b/samples/client/petstore/java/jersey2-java6/docs/ModelApiResponse.md index 3eec8686cc9..06052b202f1 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/ModelApiResponse.md +++ b/samples/client/petstore/java/jersey2-java6/docs/ModelApiResponse.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java6/docs/ModelReturn.md b/samples/client/petstore/java/jersey2-java6/docs/ModelReturn.md index a679b04953e..a7845ba254b 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/ModelReturn.md +++ b/samples/client/petstore/java/jersey2-java6/docs/ModelReturn.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java6/docs/Name.md b/samples/client/petstore/java/jersey2-java6/docs/Name.md index ce2fb4dee50..a8d6fec9714 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/Name.md +++ b/samples/client/petstore/java/jersey2-java6/docs/Name.md @@ -11,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java6/docs/NumberOnly.md b/samples/client/petstore/java/jersey2-java6/docs/NumberOnly.md index a3feac7fadc..adfb36a95bb 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/NumberOnly.md +++ b/samples/client/petstore/java/jersey2-java6/docs/NumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java6/docs/Order.md b/samples/client/petstore/java/jersey2-java6/docs/Order.md index 268c617d1ff..7e4beff6df1 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/Order.md +++ b/samples/client/petstore/java/jersey2-java6/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-java6/docs/OuterComposite.md b/samples/client/petstore/java/jersey2-java6/docs/OuterComposite.md index 3f5a633c998..1963c7a0f73 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/OuterComposite.md +++ b/samples/client/petstore/java/jersey2-java6/docs/OuterComposite.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java6/docs/Pet.md b/samples/client/petstore/java/jersey2-java6/docs/Pet.md index 5b63109ef92..1492195a58d 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/Pet.md +++ b/samples/client/petstore/java/jersey2-java6/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-java6/docs/PetApi.md b/samples/client/petstore/java/jersey2-java6/docs/PetApi.md index b5fa395947d..4758743434a 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/PetApi.md +++ b/samples/client/petstore/java/jersey2-java6/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-java6/docs/ReadOnlyFirst.md b/samples/client/petstore/java/jersey2-java6/docs/ReadOnlyFirst.md index 426b7cde95a..57655e5b49e 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/java/jersey2-java6/docs/ReadOnlyFirst.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java6/docs/SpecialModelName.md b/samples/client/petstore/java/jersey2-java6/docs/SpecialModelName.md index c2c6117c552..f4259d2a73c 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/SpecialModelName.md +++ b/samples/client/petstore/java/jersey2-java6/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-java6/docs/StoreApi.md b/samples/client/petstore/java/jersey2-java6/docs/StoreApi.md index 7aed6450e6a..a4678ee745c 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/StoreApi.md +++ b/samples/client/petstore/java/jersey2-java6/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-java6/docs/Tag.md b/samples/client/petstore/java/jersey2-java6/docs/Tag.md index de6814b55d5..7a97d4c6812 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/Tag.md +++ b/samples/client/petstore/java/jersey2-java6/docs/Tag.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java6/docs/User.md b/samples/client/petstore/java/jersey2-java6/docs/User.md index 8b6753dd284..cf7f9ce1312 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/User.md +++ b/samples/client/petstore/java/jersey2-java6/docs/User.md @@ -15,3 +15,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/jersey2-java6/docs/UserApi.md b/samples/client/petstore/java/jersey2-java6/docs/UserApi.md index 2e6987951c8..e421376ce79 100644 --- a/samples/client/petstore/java/jersey2-java6/docs/UserApi.md +++ b/samples/client/petstore/java/jersey2-java6/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-java6/git_push.sh b/samples/client/petstore/java/jersey2-java6/git_push.sh index ae01b182ae9..ed374619b13 100644 --- a/samples/client/petstore/java/jersey2-java6/git_push.sh +++ b/samples/client/petstore/java/jersey2-java6/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-java6/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/jersey2-java6/gradle/wrapper/gradle-wrapper.jar index 2c6137b8789..e69de29bb2d 100644 Binary files a/samples/client/petstore/java/jersey2-java6/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/jersey2-java6/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/jersey2-java6/pom.xml b/samples/client/petstore/java/jersey2-java6/pom.xml index e77db066489..fb9d298b382 100644 --- a/samples/client/petstore/java/jersey2-java6/pom.xml +++ b/samples/client/petstore/java/jersey2-java6/pom.xml @@ -1,278 +1,273 @@ - 4.0.0 - io.swagger - swagger-petstore-jersey2-java6 - jar - swagger-petstore-jersey2-java6 - 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-java6 + jar + swagger-petstore-jersey2-java6 + 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 - - - org.apache.commons - commons-lang3 - ${commons_lang3_version} - - - commons-io - commons-io - ${commons_io_version} - - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.5.15 - 2.6 - 2.5 - 3.6 - 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 + + + + + org.apache.commons + commons-lang3 + ${commons_lang3_version} + + + commons-io + commons-io + ${commons_io_version} + + + + + + junit + junit + ${junit-version} + test + + + + 1.5.15 + + + 2.6 + 2.5 + 3.6 + + 2.6.4 + 1.0.0 + 4.12 + diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/ApiClient.java index 56486db2a14..1290ae29484 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java6/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.media.multipart.FormDataBodyPart; import org.glassfish.jersey.media.multipart.FormDataContentDisposition; import org.glassfish.jersey.media.multipart.MultiPart; @@ -23,8 +24,10 @@ import java.io.IOException; import java.io.InputStream; + + import org.apache.commons.io.FileUtils; -import org.glassfish.jersey.filter.LoggingFilter; + import java.util.Collection; import java.util.Collections; import java.util.Map; @@ -55,7 +58,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; @@ -302,27 +304,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 @@ -585,6 +566,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); } @@ -598,8 +581,11 @@ public T deserialize(Response response, GenericType returnType) throws Ap public File downloadFileFromResponse(Response response) throws ApiException { try { File file = prepareDownloadFile(response); + + // Java6 falls back to commons.io for file copying FileUtils.copyToFile(response.readEntity(InputStream.class), file); + return file; } catch (IOException e) { throw new ApiException(e); @@ -760,9 +746,7 @@ protected Client buildHttpClient(boolean debugging) { clientConfig.register(json); clientConfig.register(JacksonFeature.class); clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); - if (debugging) { - clientConfig.register(new LoggingFilter(java.util.logging.Logger.getLogger(LoggingFilter.class.getName()), true)); - } + performAdditionalClientConfiguration(clientConfig); return ClientBuilder.newClient(clientConfig); } diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/JSON.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/JSON.java index 433f1a313e1..065b1437689 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/JSON.java +++ b/samples/client/petstore/java/jersey2-java6/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-java6/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/AnotherFakeApi.java index 494f81b84d2..41c44e53e34 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -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-java6/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java index 2980f8bb1fa..a10cd5ef785 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java @@ -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-java6/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index 41b78ca6524..9a1e8f9acb9 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -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-java6/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/PetApi.java index 6af9763779c..8621d0703ac 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/PetApi.java @@ -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-java6/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/StoreApi.java index 22be0ebb027..32c0564e1c5 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/StoreApi.java @@ -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-java6/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/UserApi.java index a7dced63d85..8b966c3c71d 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/UserApi.java @@ -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-java6/src/main/java/io/swagger/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/auth/HttpBasicAuth.java index 788b63a9918..44f4f86e490 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/java/jersey2-java6/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-java6/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index 2be1838838c..b2144d79e1b 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -28,65 +28,66 @@ */ 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 +105,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Animal.java index b64a9d4388d..96d269d1469 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Animal.java @@ -25,56 +25,61 @@ /** * 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 +97,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/AnimalFarm.java deleted file mode 100644 index 382a9368aa0..00000000000 --- a/samples/client/petstore/java/jersey2-java6/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 org.apache.commons.lang3.ObjectUtils; -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 true; - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index f4b8c8c9fb3..ab2624aeab1 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -28,36 +28,38 @@ */ 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 +76,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 7eb9c03fc79..1f2c20c2d2a 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -28,36 +28,38 @@ */ 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 +76,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayTest.java index 11505132cd9..d6bfb16d523 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayTest.java @@ -28,94 +28,98 @@ */ 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 +138,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Capitalization.java index 8bf2311949e..8fd2c68ce43 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Capitalization.java @@ -25,133 +25,134 @@ */ 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 +174,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Cat.java index 958c985cb92..588ae900240 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Cat.java @@ -26,28 +26,71 @@ */ 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 +100,23 @@ public boolean equals(java.lang.Object o) { return false; } Cat cat = (Cat) o; - return ObjectUtils.equals(this.declawed, cat.declawed) && + return ObjectUtils.equals(this.className, cat.className) && + ObjectUtils.equals(this.color, cat.color) && + ObjectUtils.equals(this.declawed, cat.declawed) && super.equals(o); } @Override public int hashCode() { - return ObjectUtils.hashCodeMulti(declawed, super.hashCode()); + return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Category.java index 1853e6d1589..491e983d76b 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Category.java @@ -25,49 +25,50 @@ */ 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 +86,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ClassModel.java index 4f3a3145863..01ad660419b 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ClassModel.java @@ -22,32 +22,32 @@ /** * 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 +64,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Client.java index d85880077b5..7227062599c 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Client.java @@ -25,28 +25,29 @@ */ 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 +64,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Dog.java index 8c67027ad96..2389881757c 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Dog.java @@ -26,28 +26,71 @@ */ 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 +100,23 @@ public boolean equals(java.lang.Object o) { return false; } Dog dog = (Dog) o; - return ObjectUtils.equals(this.breed, dog.breed) && + return ObjectUtils.equals(this.className, dog.className) && + ObjectUtils.equals(this.color, dog.color) && + ObjectUtils.equals(this.breed, dog.breed) && super.equals(o); } @Override public int hashCode() { - return ObjectUtils.hashCodeMulti(breed, super.hashCode()); + return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumArrays.java index fa58bb72b8c..2bbc06901be 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2-java6/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,58 @@ 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 +175,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumClass.java index 3c92d19b127..9414211ef6c 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumClass.java @@ -13,14 +13,17 @@ package io.swagger.client.model; -import org.apache.commons.lang3.ObjectUtils; + 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-java6/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumTest.java index 1ff3b541245..53ceb4b43d0 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumTest.java @@ -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,89 @@ 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 +249,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/FormatTest.java index 1eac24d55c6..399a4dd55ef 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/FormatTest.java @@ -29,290 +29,285 @@ */ 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 +336,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index cbf3cb3f955..653e9c13c3f 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -25,31 +25,34 @@ */ 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 +70,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MapTest.java index 6e0a97bbc72..5a17a9d0d65 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java6/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,65 @@ 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 +144,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 5ff907a7900..35ec4bcd898 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -31,78 +31,79 @@ */ 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 +122,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Model200Response.java index b32ea0a16c4..033a9d40a8a 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Model200Response.java @@ -22,53 +22,53 @@ /** * 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 +86,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ModelApiResponse.java index 764534696b7..fe524198518 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -25,70 +25,71 @@ */ 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 +108,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ModelReturn.java index f8c0979d43c..298302ebffa 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ModelReturn.java @@ -22,32 +22,32 @@ /** * 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 +64,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(_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-java6/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Name.java index a3c678b021f..e1fd734b50b 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Name.java @@ -22,77 +22,79 @@ /** * 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 +114,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/NumberOnly.java index a4fffd86805..a68b6bafcf8 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/NumberOnly.java @@ -26,28 +26,29 @@ */ 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 +65,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Order.java index fba033c63b9..fb956f26520 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/jersey2-java6/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,125 @@ 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 +215,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterComposite.java index 0f84b926a5b..4fd833a3167 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterComposite.java @@ -26,70 +26,71 @@ */ 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 +109,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterEnum.java index f8a903d325a..3390d473c7b 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterEnum.java @@ -13,14 +13,17 @@ package io.swagger.client.model; -import org.apache.commons.lang3.ObjectUtils; + 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-java6/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Pet.java index be3b82347e4..967279b3df2 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java6/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,136 @@ 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 +232,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index 8aa0c00583e..fdf63f5a232 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -25,40 +25,42 @@ */ 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 +78,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/SpecialModelName.java index 6c750b2d75d..b39af6737e4 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -25,28 +25,29 @@ */ 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 +56,20 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName specialModelName = (SpecialModelName) o; - return ObjectUtils.equals(this.specialPropertyName, specialModelName.specialPropertyName); + SpecialModelName $specialModelName = (SpecialModelName) o; + return ObjectUtils.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); } @Override public int hashCode() { - return ObjectUtils.hashCodeMulti(specialPropertyName); + return ObjectUtils.hashCodeMulti($specialPropertyName); } - - @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-java6/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Tag.java index c1d2ba92ee2..0df45c86a2b 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Tag.java @@ -25,49 +25,50 @@ */ 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 +86,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/User.java index 04bfc454d25..75543db513b 100644 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/User.java @@ -25,175 +25,176 @@ */ 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 +218,6 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return ObjectUtils.hashCodeMulti(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-java6/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java index a5339a392d2..f2b031f9485 100644 --- a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -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-java6/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/FakeApiTest.java index 0e4979b2906..9710cbe6764 100644 --- a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -16,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-java6/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index af5885aaddd..dbda3faa692 100644 --- a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -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-java6/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/PetApiTest.java index 349a55d93dc..f02c13872eb 100644 --- a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/PetApiTest.java @@ -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-java6/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/StoreApiTest.java index bef0884a2da..c6d9b89f0bd 100644 --- a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -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-java6/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/UserApiTest.java index 4455b3920b9..175f42fca9c 100644 --- a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/UserApiTest.java @@ -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/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/ApiClient.java index cf1a2f6d5de..7e74cdd6903 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,7 +15,9 @@ 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; @@ -746,12 +748,14 @@ protected Client buildHttpClient(boolean debugging) { clientConfig.register(json); clientConfig.register(JacksonFeature.class); clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); + if (debugging) { clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */)); clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY); // Set logger to ALL java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME).setLevel(java.util.logging.Level.ALL); } + performAdditionalClientConfiguration(clientConfig); return ClientBuilder.newClient(clientConfig); } 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 cf1a2f6d5de..7e74cdd6903 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,7 +15,9 @@ 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; @@ -746,12 +748,14 @@ protected Client buildHttpClient(boolean debugging) { clientConfig.register(json); clientConfig.register(JacksonFeature.class); clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); + if (debugging) { clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */)); clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY); // Set logger to ALL java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME).setLevel(java.util.logging.Level.ALL); } + performAdditionalClientConfiguration(clientConfig); return ClientBuilder.newClient(clientConfig); } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/.swagger-codegen/VERSION b/samples/client/petstore/java/okhttp-gson-parcelableModel/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/.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/okhttp-gson-parcelableModel/README.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md index 8e55bbc51a2..387f4090dca 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/README.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/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,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/okhttp-gson-parcelableModel/build.gradle b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle index c11d2e8f805..49d5c22cb54 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/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 @@ -98,7 +101,9 @@ dependencies { compile 'com.squareup.okhttp:okhttp:2.7.5' compile 'com.squareup.okhttp:logging-interceptor:2.7.5' compile 'com.google.code.gson:gson:2.8.1' - compile 'io.gsonfire:gson-fire:1.8.0' + + compile 'org.threeten:threetenbp:1.3.5' + testCompile 'junit:junit:4.12' } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt index db083233db7..83d5c6b8d5d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt @@ -13,8 +13,10 @@ lazy val root = (project in file(".")). "com.squareup.okhttp" % "okhttp" % "2.7.5", "com.squareup.okhttp" % "logging-interceptor" % "2.7.5", "com.google.code.gson" % "gson" % "2.8.1", + + "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.10" % "test" ) diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesClass.md index 0437c4dd8cc..b37862da7cf 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AdditionalPropertiesClass.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Animal.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Animal.md index b3f325c3524..346caaf63f4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Animal.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Animal.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AnimalFarm.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AnimalFarm.md deleted file mode 100644 index c7c7f1ddcce..00000000000 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ - -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AnotherFakeApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AnotherFakeApi.md index 7a04619aaba..fb5c988e6cc 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/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/okhttp-gson-parcelableModel/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayOfArrayOfNumberOnly.md index 77292549927..3671a5e9190 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayOfArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayOfNumberOnly.md index e8cc4cd36dc..30b9b6648f4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayTest.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayTest.md index 9feee16427f..4ab76343030 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayTest.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ArrayTest.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Capitalization.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Capitalization.md index 0f3064c1996..9af7864f97e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Capitalization.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Capitalization.md @@ -13,3 +13,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Cat.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Cat.md index 6e9f71ce7dd..5e408344021 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Cat.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/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/okhttp-gson-parcelableModel/docs/Category.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Category.md index e2df0803278..deb5a3e2a52 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Category.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Category.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ClassModel.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ClassModel.md index 64f880c8786..49c281cc0ed 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ClassModel.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ClassModel.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Client.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Client.md index 5c490ea166c..52b2f72c79c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Client.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Client.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Dog.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Dog.md index ac7cea323ff..00e6446e9f5 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Dog.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/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/okhttp-gson-parcelableModel/docs/EnumArrays.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumArrays.md index 4dddc0bfd27..939a0e69587 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumArrays.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/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/okhttp-gson-parcelableModel/docs/EnumTest.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md index 08fee344882..9722c621962 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/EnumTest.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/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/okhttp-gson-parcelableModel/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md index 737ccc28293..6690b870e4e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/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/okhttp-gson-parcelableModel/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeClassnameTags123Api.md index bc728bfce5b..2bcbbb7908f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/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/okhttp-gson-parcelableModel/docs/FormatTest.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FormatTest.md index c7a3acb3cb7..bc11b93cb26 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/FormatTest.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/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/okhttp-gson-parcelableModel/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/HasOnlyReadOnly.md index c1d0aac5672..5564ddcf28a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/HasOnlyReadOnly.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MapTest.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MapTest.md index 714a97a40d9..74a6fe8ae70 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MapTest.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/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/okhttp-gson-parcelableModel/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MixedPropertiesAndAdditionalPropertiesClass.md index b12e2cd70e6..4507481b5a9 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Model200Response.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Model200Response.md index 5b3a9a0e46d..8d2cc50bb83 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Model200Response.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Model200Response.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelApiResponse.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelApiResponse.md index 3eec8686cc9..06052b202f1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelApiResponse.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelApiResponse.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelReturn.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelReturn.md index a679b04953e..a7845ba254b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelReturn.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelReturn.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Name.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Name.md index ce2fb4dee50..a8d6fec9714 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Name.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Name.md @@ -11,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/NumberOnly.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/NumberOnly.md index a3feac7fadc..adfb36a95bb 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/NumberOnly.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/NumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Order.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Order.md index 268c617d1ff..7e4beff6df1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Order.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/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/okhttp-gson-parcelableModel/docs/OuterComposite.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/OuterComposite.md index 3f5a633c998..1963c7a0f73 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/OuterComposite.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/OuterComposite.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Pet.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Pet.md index 5b63109ef92..1492195a58d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Pet.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/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/okhttp-gson-parcelableModel/docs/PetApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/PetApi.md index b5fa395947d..4758743434a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/PetApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/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/okhttp-gson-parcelableModel/docs/ReadOnlyFirst.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ReadOnlyFirst.md index 426b7cde95a..57655e5b49e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ReadOnlyFirst.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/SpecialModelName.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/SpecialModelName.md index c2c6117c552..f4259d2a73c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/SpecialModelName.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/SpecialModelName.md @@ -4,7 +4,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] +**$specialPropertyName** | **Long** | | [optional] + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/StoreApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/StoreApi.md index 7aed6450e6a..a4678ee745c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/StoreApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/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/okhttp-gson-parcelableModel/docs/Tag.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Tag.md index de6814b55d5..7a97d4c6812 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Tag.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Tag.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/User.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/User.md index 8b6753dd284..cf7f9ce1312 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/User.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/User.md @@ -15,3 +15,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/UserApi.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/UserApi.md index 2e6987951c8..e421376ce79 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/UserApi.md +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/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/okhttp-gson-parcelableModel/git_push.sh b/samples/client/petstore/java/okhttp-gson-parcelableModel/git_push.sh index ae01b182ae9..ed374619b13 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/git_push.sh +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/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/okhttp-gson-parcelableModel/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/okhttp-gson-parcelableModel/gradle/wrapper/gradle-wrapper.jar index 2c6137b8789..e69de29bb2d 100644 Binary files a/samples/client/petstore/java/okhttp-gson-parcelableModel/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/okhttp-gson-parcelableModel/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml index 9996b04cbd8..4ed62b3bffa 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml @@ -1,249 +1,236 @@ - 4.0.0 - io.swagger - swagger-petstore-okhttp-gson - jar - swagger-petstore-okhttp-gson - 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-okhttp-gson + jar + swagger-petstore-okhttp-gson + 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-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-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.okhttp - okhttp - ${okhttp-version} - - - com.squareup.okhttp - logging-interceptor - ${okhttp-version} - - - com.google.code.gson - gson - ${gson-version} - - - io.gsonfire - gson-fire - ${gson-fire-version} - - - org.threeten - threetenbp - ${threetenbp-version} - - - - com.google.android - android - 4.1.1.4 - provided - - - - junit - junit - ${junit-version} - test - - - - 1.7 - ${java.version} - ${java.version} - 1.8.0 - 1.5.15 - 2.7.5 - 2.8.1 - 1.3.5 - 1.0.0 - 4.12 - UTF-8 - + + + io.swagger + swagger-annotations + ${swagger-core-version} + + + com.squareup.okhttp + okhttp + ${okhttp-version} + + + com.squareup.okhttp + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + + + org.threeten + threetenbp + ${threetenbp-version} + + + + + + + + + com.google.android + android + 4.1.1.4 + provided + + + + + junit + junit + ${junit-version} + test + + + + 1.7 + ${java.version} + ${java.version} + 1.5.15 + 2.7.5 + 2.8.1 + + + + 1.3.5 + + 1.0.0 + 4.12 + UTF-8 + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java index a82ca551679..16995930624 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java @@ -19,10 +19,13 @@ import com.squareup.okhttp.logging.HttpLoggingInterceptor.Level; import okio.BufferedSink; import okio.Okio; + + import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import org.threeten.bp.format.DateTimeFormatter; + import javax.net.ssl.*; import java.io.File; import java.io.IOException; @@ -39,6 +42,7 @@ import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import java.text.DateFormat; + import java.util.*; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; @@ -79,6 +83,7 @@ public class ApiClient { public ApiClient() { httpClient = new OkHttpClient(); + verifyingSsl = true; @@ -233,6 +238,8 @@ public ApiClient setSqlDateFormat(DateFormat dateFormat) { return this; } + + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { this.json.setOffsetDateTimeFormat(dateFormat); return this; @@ -243,6 +250,7 @@ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { return this; } + public ApiClient setLenientOnJson(boolean lenientOnJson) { this.json.setLenientOnJson(lenientOnJson); return this; @@ -408,7 +416,7 @@ public String getTempFolderPath() { } /** - * Set the temporary folder path (for downloading files) + * Set the tempoaray folder path (for downloading files) * * @param tempFolderPath Temporary folder path * @return ApiClient @@ -430,7 +438,6 @@ public int getConnectTimeout() { /** * Sets the connect timeout (in milliseconds). * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link Integer#MAX_VALUE}. * * @param connectionTimeout connection timeout in milliseconds * @return Api client @@ -440,50 +447,6 @@ public ApiClient setConnectTimeout(int connectionTimeout) { return this; } - /** - * Get read timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getReadTimeout() { - return httpClient.getReadTimeout(); - } - - /** - * Sets 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) { - httpClient.setReadTimeout(readTimeout, TimeUnit.MILLISECONDS); - return this; - } - - /** - * Get write timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getWriteTimeout() { - return httpClient.getWriteTimeout(); - } - - /** - * Sets the write timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link Integer#MAX_VALUE}. - * - * @param writeTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setWriteTimeout(int writeTimeout) { - httpClient.setWriteTimeout(writeTimeout, TimeUnit.MILLISECONDS); - return this; - } - /** * Format the given parameter object into string. * diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/JSON.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/JSON.java index df84d970239..f0b104f8b32 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/JSON.java @@ -20,14 +20,12 @@ import com.google.gson.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -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; import java.io.StringReader; @@ -35,58 +33,29 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; + import java.util.Date; -import java.util.Map; -import java.util.HashMap; public class JSON { private Gson gson; private boolean isLenientOnJson = false; 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")); - } - }) - ; - return fireBuilder.createGsonBuilder(); - } - - private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { - JsonElement element = readElement.getAsJsonObject().get(discriminatorField); - if(null == element) { - throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); - } - return element.getAsString(); - } - - private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { - Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue.toUpperCase()); - if(null == clazz) { - throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); - } - return clazz; - } + public JSON() { - gson = createGson() + gson = new GsonBuilder() .registerTypeAdapter(Date.class, dateTypeAdapter) .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) + + .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) + .create(); } @@ -153,6 +122,8 @@ public T deserialize(String body, Type returnType) { } } + + /** * Gson TypeAdapter for JSR310 OffsetDateTime type */ @@ -248,6 +219,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/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/AnotherFakeApi.java index e8abc4b61d6..19a39ad477e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -22,19 +22,26 @@ import io.swagger.client.ProgressRequestBody; import io.swagger.client.ProgressResponseBody; + import com.google.gson.reflect.TypeToken; import java.io.IOException; + + import io.swagger.client.model.Client; + import java.lang.reflect.Type; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class AnotherFakeApi { private ApiClient apiClient; @@ -54,17 +61,19 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * Build call for testSpecialTags - * @param body client model (required) + * @param client client model (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call testSpecialTagsCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - + public com.squareup.okhttp.Call testSpecialTagsCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = client; + // create path and map variables String localVarPath = "/another-fake/dummy"; @@ -102,42 +111,51 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testSpecialTagsValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testSpecialTagsValidateBeforeCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling testSpecialTags(Async)"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException("Missing the required parameter 'client' when calling testSpecialTags(Async)"); } - - com.squareup.okhttp.Call call = testSpecialTagsCall(body, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = testSpecialTagsCall(client, progressListener, progressRequestListener); return call; + + + + + + } /** * To test special tags * To test special tags - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public Client testSpecialTags(Client body) throws ApiException { - ApiResponse resp = testSpecialTagsWithHttpInfo(body); + public Client testSpecialTags(Client client) throws ApiException { + ApiResponse resp = testSpecialTagsWithHttpInfo(client); return resp.getData(); } /** * To test special tags * To test special tags - * @param body client model (required) + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse testSpecialTagsWithHttpInfo(Client body) throws ApiException { - com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(body, null, null); + public ApiResponse testSpecialTagsWithHttpInfo(Client client) throws ApiException { + com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(client, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -145,12 +163,13 @@ public ApiResponse testSpecialTagsWithHttpInfo(Client body) throws ApiEx /** * To test special tags (asynchronously) * To test special tags - * @param body client model (required) + * @param client client model (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call testSpecialTagsAsync(Client body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testSpecialTagsAsync(Client client, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -171,9 +190,10 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(client, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } + } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeApi.java index beb9cb1f8ff..1b84a7af7c1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeApi.java @@ -22,23 +22,28 @@ import io.swagger.client.ProgressRequestBody; import io.swagger.client.ProgressResponseBody; + import com.google.gson.reflect.TypeToken; import java.io.IOException; + + 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.lang.reflect.Type; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class FakeApi { private ApiClient apiClient; @@ -58,6 +63,7 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * Build call for fakeOuterBooleanSerialize * @param body Input boolean as post body (optional) @@ -65,10 +71,11 @@ public void setApiClient(ApiClient apiClient) { * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call fakeOuterBooleanSerializeCall(Boolean body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; - + // create path and map variables String localVarPath = "/fake/outer/boolean"; @@ -80,13 +87,13 @@ public com.squareup.okhttp.Call fakeOuterBooleanSerializeCall(Boolean body, fina Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -106,14 +113,21 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call fakeOuterBooleanSerializeValidateBeforeCall(Boolean body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - + + com.squareup.okhttp.Call call = fakeOuterBooleanSerializeCall(body, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -122,6 +136,7 @@ private com.squareup.okhttp.Call fakeOuterBooleanSerializeValidateBeforeCall(Boo * @param body Input boolean as post body (optional) * @return Boolean * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { ApiResponse resp = fakeOuterBooleanSerializeWithHttpInfo(body); @@ -134,6 +149,7 @@ public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { * @param body Input boolean as post body (optional) * @return ApiResponse<Boolean> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { com.squareup.okhttp.Call call = fakeOuterBooleanSerializeValidateBeforeCall(body, null, null); @@ -148,6 +164,7 @@ public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call fakeOuterBooleanSerializeAsync(Boolean body, final ApiCallback callback) throws ApiException { @@ -175,17 +192,19 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for fakeOuterCompositeSerialize - * @param body Input composite as post body (optional) + * @param outercomposite Input composite as post body (optional) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call fakeOuterCompositeSerializeCall(OuterComposite body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - + public com.squareup.okhttp.Call fakeOuterCompositeSerializeCall(OuterComposite outercomposite, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = outercomposite; + // create path and map variables String localVarPath = "/fake/outer/composite"; @@ -197,13 +216,13 @@ public com.squareup.okhttp.Call fakeOuterCompositeSerializeCall(OuterComposite b Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -223,37 +242,46 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call fakeOuterCompositeSerializeValidateBeforeCall(OuterComposite body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call fakeOuterCompositeSerializeValidateBeforeCall(OuterComposite outercomposite, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = fakeOuterCompositeSerializeCall(body, progressListener, progressRequestListener); + + + com.squareup.okhttp.Call call = fakeOuterCompositeSerializeCall(outercomposite, progressListener, progressRequestListener); return call; + + + + + + } /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outercomposite Input composite as post body (optional) * @return OuterComposite * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws ApiException { - ApiResponse resp = fakeOuterCompositeSerializeWithHttpInfo(body); + public OuterComposite fakeOuterCompositeSerialize(OuterComposite outercomposite) throws ApiException { + ApiResponse resp = fakeOuterCompositeSerializeWithHttpInfo(outercomposite); return resp.getData(); } /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outercomposite Input composite as post body (optional) * @return ApiResponse<OuterComposite> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws ApiException { - com.squareup.okhttp.Call call = fakeOuterCompositeSerializeValidateBeforeCall(body, null, null); + public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite outercomposite) throws ApiException { + com.squareup.okhttp.Call call = fakeOuterCompositeSerializeValidateBeforeCall(outercomposite, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -261,12 +289,13 @@ public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(Outer /** * (asynchronously) * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outercomposite Input composite as post body (optional) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call fakeOuterCompositeSerializeAsync(OuterComposite body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call fakeOuterCompositeSerializeAsync(OuterComposite outercomposite, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -287,11 +316,12 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = fakeOuterCompositeSerializeValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = fakeOuterCompositeSerializeValidateBeforeCall(outercomposite, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for fakeOuterNumberSerialize * @param body Input number as post body (optional) @@ -299,10 +329,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call fakeOuterNumberSerializeCall(BigDecimal body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; - + // create path and map variables String localVarPath = "/fake/outer/number"; @@ -314,13 +345,13 @@ public com.squareup.okhttp.Call fakeOuterNumberSerializeCall(BigDecimal body, fi Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -340,14 +371,21 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call fakeOuterNumberSerializeValidateBeforeCall(BigDecimal body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - + + com.squareup.okhttp.Call call = fakeOuterNumberSerializeCall(body, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -356,6 +394,7 @@ private com.squareup.okhttp.Call fakeOuterNumberSerializeValidateBeforeCall(BigD * @param body Input number as post body (optional) * @return BigDecimal * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException { ApiResponse resp = fakeOuterNumberSerializeWithHttpInfo(body); @@ -368,6 +407,7 @@ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException * @param body Input number as post body (optional) * @return ApiResponse<BigDecimal> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException { com.squareup.okhttp.Call call = fakeOuterNumberSerializeValidateBeforeCall(body, null, null); @@ -382,6 +422,7 @@ public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal b * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call fakeOuterNumberSerializeAsync(BigDecimal body, final ApiCallback callback) throws ApiException { @@ -409,6 +450,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for fakeOuterStringSerialize * @param body Input string as post body (optional) @@ -416,10 +458,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call fakeOuterStringSerializeCall(String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; - + // create path and map variables String localVarPath = "/fake/outer/string"; @@ -431,13 +474,13 @@ public com.squareup.okhttp.Call fakeOuterStringSerializeCall(String body, final Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -457,14 +500,21 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call fakeOuterStringSerializeValidateBeforeCall(String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - + + com.squareup.okhttp.Call call = fakeOuterStringSerializeCall(body, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -473,6 +523,7 @@ private com.squareup.okhttp.Call fakeOuterStringSerializeValidateBeforeCall(Stri * @param body Input string as post body (optional) * @return String * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public String fakeOuterStringSerialize(String body) throws ApiException { ApiResponse resp = fakeOuterStringSerializeWithHttpInfo(body); @@ -485,6 +536,7 @@ public String fakeOuterStringSerialize(String body) throws ApiException { * @param body Input string as post body (optional) * @return ApiResponse<String> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) throws ApiException { com.squareup.okhttp.Call call = fakeOuterStringSerializeValidateBeforeCall(body, null, null); @@ -499,6 +551,7 @@ public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) thr * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call fakeOuterStringSerializeAsync(String body, final ApiCallback callback) throws ApiException { @@ -526,17 +579,19 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for testClientModel - * @param body client model (required) + * @param client client model (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call testClientModelCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - + public com.squareup.okhttp.Call testClientModelCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = client; + // create path and map variables String localVarPath = "/fake"; @@ -574,42 +629,51 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testClientModelValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testClientModelValidateBeforeCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling testClientModel(Async)"); + + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException("Missing the required parameter 'client' when calling testClientModel(Async)"); } - - com.squareup.okhttp.Call call = testClientModelCall(body, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = testClientModelCall(client, progressListener, progressRequestListener); return call; + + + + + + } /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public Client testClientModel(Client body) throws ApiException { - ApiResponse resp = testClientModelWithHttpInfo(body); + public Client testClientModel(Client client) throws ApiException { + ApiResponse resp = testClientModelWithHttpInfo(client); return resp.getData(); } /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse testClientModelWithHttpInfo(Client body) throws ApiException { - com.squareup.okhttp.Call call = testClientModelValidateBeforeCall(body, null, null); + public ApiResponse testClientModelWithHttpInfo(Client client) throws ApiException { + com.squareup.okhttp.Call call = testClientModelValidateBeforeCall(client, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -617,12 +681,13 @@ public ApiResponse testClientModelWithHttpInfo(Client body) throws ApiEx /** * To test \"client\" model (asynchronously) * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call testClientModelAsync(Client body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testClientModelAsync(Client client, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -643,35 +708,24 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = testClientModelValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testClientModelValidateBeforeCall(client, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for testEndpointParameters - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) + * @param body (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - + public com.squareup.okhttp.Call testEndpointParametersCall(Object body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + // create path and map variables String localVarPath = "/fake"; @@ -681,37 +735,9 @@ public com.squareup.okhttp.Call testEndpointParametersCall(BigDecimal number, Do 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); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -737,106 +763,62 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "http_basic_test" }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testEndpointParametersValidateBeforeCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - // verify the required parameter 'number' is set - if (number == null) { - throw new ApiException("Missing the required parameter 'number' when calling testEndpointParameters(Async)"); - } + private com.squareup.okhttp.Call testEndpointParametersValidateBeforeCall(Object body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter '_double' is set - if (_double == null) { - throw new ApiException("Missing the required parameter '_double' when calling testEndpointParameters(Async)"); - } - // verify the required parameter 'patternWithoutDelimiter' is set - if (patternWithoutDelimiter == null) { - throw new ApiException("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters(Async)"); + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling testEndpointParameters(Async)"); } - // verify the required parameter '_byte' is set - if (_byte == null) { - throw new ApiException("Missing the required parameter '_byte' when calling testEndpointParameters(Async)"); - } - - com.squareup.okhttp.Call call = testEndpointParametersCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testEndpointParametersCall(body, progressListener, progressRequestListener); return call; + + + + + + } /** * 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 fail to call the API, e.g. server error or cannot deserialize the response body + */ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { - testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + public void testEndpointParameters(Object body) throws ApiException { + testEndpointParametersWithHttpInfo(body); } /** * 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 ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { - com.squareup.okhttp.Call call = testEndpointParametersValidateBeforeCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, null, null); + public ApiResponse testEndpointParametersWithHttpInfo(Object body) throws ApiException { + com.squareup.okhttp.Call call = testEndpointParametersValidateBeforeCall(body, null, null); return apiClient.execute(call); } /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 (asynchronously) * 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 callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call testEndpointParametersAsync(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testEndpointParametersAsync(Object body, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -857,35 +839,35 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = testEndpointParametersValidateBeforeCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testEndpointParametersValidateBeforeCall(body, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } + /** * Build call for testEnumParameters - * @param enumFormStringArray Form parameter enum test (string array) (optional) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @param 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 progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call testEnumParametersCall(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - + public com.squareup.okhttp.Call testEnumParametersCall(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + // create path and map variables String localVarPath = "/fake"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); if (enumQueryStringArray != null) - localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray)); + localVarQueryParams.addAll(apiClient.parameterToPair("enum_query_string_array", enumQueryStringArray)); if (enumQueryString != null) localVarQueryParams.addAll(apiClient.parameterToPair("enum_query_string", enumQueryString)); if (enumQueryInteger != null) @@ -898,15 +880,9 @@ public com.squareup.okhttp.Call testEnumParametersCall(List enumFormStri localVarHeaderParams.put("enum_header_string", apiClient.parameterToString(enumHeaderString)); 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); final String[] localVarAccepts = { - "*/*" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -932,68 +908,72 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testEnumParametersValidateBeforeCall(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testEnumParametersValidateBeforeCall(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = testEnumParametersCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, progressListener, progressRequestListener); + + + com.squareup.okhttp.Call call = testEnumParametersCall(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, progressListener, progressRequestListener); return call; + + + + + + } /** * 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 fail to call the API, e.g. server error or cannot deserialize the response body + */ - public void testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws ApiException { - testEnumParametersWithHttpInfo(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + public void testEnumParameters(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger) throws ApiException { + testEnumParametersWithHttpInfo(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); } /** * 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 ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse testEnumParametersWithHttpInfo(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws ApiException { - com.squareup.okhttp.Call call = testEnumParametersValidateBeforeCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, null, null); + public ApiResponse testEnumParametersWithHttpInfo(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger) throws ApiException { + com.squareup.okhttp.Call call = testEnumParametersValidateBeforeCall(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, null, null); return apiClient.execute(call); } /** * To test enum parameters (asynchronously) * To test enum parameters - * @param enumFormStringArray Form parameter enum test (string array) (optional) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @param 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 callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call testEnumParametersAsync(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testEnumParametersAsync(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1014,21 +994,23 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = testEnumParametersValidateBeforeCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testEnumParametersValidateBeforeCall(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } + /** * Build call for testInlineAdditionalProperties - * @param param request body (required) + * @param body request body (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call testInlineAdditionalPropertiesCall(Object param, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = param; - + public com.squareup.okhttp.Call testInlineAdditionalPropertiesCall(Map body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + // create path and map variables String localVarPath = "/fake/inline-additionalProperties"; @@ -1066,52 +1048,62 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testInlineAdditionalPropertiesValidateBeforeCall(Object param, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testInlineAdditionalPropertiesValidateBeforeCall(Map body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + - // verify the required parameter 'param' is set - if (param == null) { - throw new ApiException("Missing the required parameter 'param' when calling testInlineAdditionalProperties(Async)"); + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling testInlineAdditionalProperties(Async)"); } - - com.squareup.okhttp.Call call = testInlineAdditionalPropertiesCall(param, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = testInlineAdditionalPropertiesCall(body, progressListener, progressRequestListener); return call; + + + + + + } /** * test inline additionalProperties * - * @param param request body (required) + * @param body request body (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public void testInlineAdditionalProperties(Object param) throws ApiException { - testInlineAdditionalPropertiesWithHttpInfo(param); + public void testInlineAdditionalProperties(Map body) throws ApiException { + testInlineAdditionalPropertiesWithHttpInfo(body); } /** * test inline additionalProperties * - * @param param request body (required) + * @param body request body (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Object param) throws ApiException { - com.squareup.okhttp.Call call = testInlineAdditionalPropertiesValidateBeforeCall(param, null, null); + public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Map body) throws ApiException { + com.squareup.okhttp.Call call = testInlineAdditionalPropertiesValidateBeforeCall(body, null, null); return apiClient.execute(call); } /** * test inline additionalProperties (asynchronously) * - * @param param request body (required) + * @param body request body (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call testInlineAdditionalPropertiesAsync(Object param, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testInlineAdditionalPropertiesAsync(Map body, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1132,22 +1124,23 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = testInlineAdditionalPropertiesValidateBeforeCall(param, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testInlineAdditionalPropertiesValidateBeforeCall(body, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } + /** * Build call for testJsonFormData - * @param param field1 (required) - * @param param2 field2 (required) + * @param body (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call testJsonFormDataCall(String param, String param2, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - + public com.squareup.okhttp.Call testJsonFormDataCall(Object body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + // create path and map variables String localVarPath = "/fake/jsonFormData"; @@ -1157,10 +1150,6 @@ public com.squareup.okhttp.Call testJsonFormDataCall(String param, String param2 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 = { @@ -1189,60 +1178,62 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testJsonFormDataValidateBeforeCall(String param, String param2, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testJsonFormDataValidateBeforeCall(Object body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'param' is set - if (param == null) { - throw new ApiException("Missing the required parameter 'param' when calling testJsonFormData(Async)"); - } - // verify the required parameter 'param2' is set - if (param2 == null) { - throw new ApiException("Missing the required parameter 'param2' when calling testJsonFormData(Async)"); + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling testJsonFormData(Async)"); } - - com.squareup.okhttp.Call call = testJsonFormDataCall(param, param2, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = testJsonFormDataCall(body, progressListener, progressRequestListener); return call; + + + + + + } /** * test json serialization of form data * - * @param param field1 (required) - * @param param2 field2 (required) + * @param body (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public void testJsonFormData(String param, String param2) throws ApiException { - testJsonFormDataWithHttpInfo(param, param2); + public void testJsonFormData(Object body) throws ApiException { + testJsonFormDataWithHttpInfo(body); } /** * test json serialization of form data * - * @param param field1 (required) - * @param param2 field2 (required) + * @param body (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException { - com.squareup.okhttp.Call call = testJsonFormDataValidateBeforeCall(param, param2, null, null); + public ApiResponse testJsonFormDataWithHttpInfo(Object body) throws ApiException { + com.squareup.okhttp.Call call = testJsonFormDataValidateBeforeCall(body, null, null); return apiClient.execute(call); } /** * test json serialization of form data (asynchronously) * - * @param param field1 (required) - * @param param2 field2 (required) + * @param body (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call testJsonFormDataAsync(String param, String param2, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testJsonFormDataAsync(Object body, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1263,8 +1254,9 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = testJsonFormDataValidateBeforeCall(param, param2, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testJsonFormDataValidateBeforeCall(body, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } + } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index cd516030e2c..0fe5985902b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -22,19 +22,26 @@ import io.swagger.client.ProgressRequestBody; import io.swagger.client.ProgressResponseBody; + import com.google.gson.reflect.TypeToken; import java.io.IOException; + + import io.swagger.client.model.Client; + import java.lang.reflect.Type; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class FakeClassnameTags123Api { private ApiClient apiClient; @@ -54,17 +61,19 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * Build call for testClassname - * @param body client model (required) + * @param client client model (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call testClassnameCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - + public com.squareup.okhttp.Call testClassnameCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = client; + // create path and map variables String localVarPath = "/fake_classname_test"; @@ -102,42 +111,51 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "api_key_query" }; return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testClassnameValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testClassnameValidateBeforeCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling testClassname(Async)"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException("Missing the required parameter 'client' when calling testClassname(Async)"); } - - com.squareup.okhttp.Call call = testClassnameCall(body, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = testClassnameCall(client, progressListener, progressRequestListener); return call; + + + + + + } /** * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public Client testClassname(Client body) throws ApiException { - ApiResponse resp = testClassnameWithHttpInfo(body); + public Client testClassname(Client client) throws ApiException { + ApiResponse resp = testClassnameWithHttpInfo(client); return resp.getData(); } /** * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse testClassnameWithHttpInfo(Client body) throws ApiException { - com.squareup.okhttp.Call call = testClassnameValidateBeforeCall(body, null, null); + public ApiResponse testClassnameWithHttpInfo(Client client) throws ApiException { + com.squareup.okhttp.Call call = testClassnameValidateBeforeCall(client, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -145,12 +163,13 @@ public ApiResponse testClassnameWithHttpInfo(Client body) throws ApiExce /** * To test class name in snake case (asynchronously) * - * @param body client model (required) + * @param client client model (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call testClassnameAsync(Client body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testClassnameAsync(Client client, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -171,9 +190,10 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = testClassnameValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testClassnameValidateBeforeCall(client, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } + } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/PetApi.java index 23b9049e61b..1749a61495a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/PetApi.java @@ -22,21 +22,27 @@ import io.swagger.client.ProgressRequestBody; import io.swagger.client.ProgressResponseBody; + import com.google.gson.reflect.TypeToken; import java.io.IOException; -import java.io.File; + + import io.swagger.client.model.ModelApiResponse; import io.swagger.client.model.Pet; + import java.lang.reflect.Type; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class PetApi { private ApiClient apiClient; @@ -56,17 +62,19 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * Build call for addPet - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call addPetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - + public com.squareup.okhttp.Call addPetCall(Pet pet, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = pet; + // create path and map variables String localVarPath = "/pet"; @@ -78,7 +86,7 @@ public com.squareup.okhttp.Call addPetCall(Pet body, final ProgressResponseBody. Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -104,52 +112,62 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "petstore_auth" }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call addPetValidateBeforeCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call addPetValidateBeforeCall(Pet pet, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling addPet(Async)"); + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException("Missing the required parameter 'pet' when calling addPet(Async)"); } - - com.squareup.okhttp.Call call = addPetCall(body, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = addPetCall(pet, progressListener, progressRequestListener); return call; + + + + + + } /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public void addPet(Pet body) throws ApiException { - addPetWithHttpInfo(body); + public void addPet(Pet pet) throws ApiException { + addPetWithHttpInfo(pet); } /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse addPetWithHttpInfo(Pet body) throws ApiException { - com.squareup.okhttp.Call call = addPetValidateBeforeCall(body, null, null); + public ApiResponse addPetWithHttpInfo(Pet pet) throws ApiException { + com.squareup.okhttp.Call call = addPetValidateBeforeCall(pet, null, null); return apiClient.execute(call); } /** * Add a new pet to the store (asynchronously) * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call addPetAsync(Pet body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call addPetAsync(Pet pet, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -170,10 +188,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = addPetValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = addPetValidateBeforeCall(pet, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } + /** * Build call for deletePet * @param petId Pet id to delete (required) @@ -182,10 +201,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call deletePetCall(Long petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + public com.squareup.okhttp.Call deletePetCall(Integer petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); @@ -200,7 +220,7 @@ public com.squareup.okhttp.Call deletePetCall(Long petId, String apiKey, final P Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -226,19 +246,26 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "petstore_auth" }; return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call deletePetValidateBeforeCall(Long petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call deletePetValidateBeforeCall(Integer petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling deletePet(Async)"); } - + com.squareup.okhttp.Call call = deletePetCall(petId, apiKey, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -247,8 +274,9 @@ private com.squareup.okhttp.Call deletePetValidateBeforeCall(Long petId, String * @param petId Pet id to delete (required) * @param apiKey (optional) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public void deletePet(Long petId, String apiKey) throws ApiException { + public void deletePet(Integer petId, String apiKey) throws ApiException { deletePetWithHttpInfo(petId, apiKey); } @@ -259,8 +287,9 @@ public void deletePet(Long petId, String apiKey) throws ApiException { * @param apiKey (optional) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { + public ApiResponse deletePetWithHttpInfo(Integer petId, String apiKey) throws ApiException { com.squareup.okhttp.Call call = deletePetValidateBeforeCall(petId, apiKey, null, null); return apiClient.execute(call); } @@ -273,8 +302,9 @@ public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call deletePetAsync(Long petId, String apiKey, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call deletePetAsync(Integer petId, String apiKey, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -299,6 +329,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, callback); return call; } + /** * Build call for findPetsByStatus * @param status Status values that need to be considered for filter (required) @@ -306,17 +337,18 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call findPetsByStatusCall(List status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/pet/findByStatus"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); if (status != null) - localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status)); + localVarQueryParams.addAll(apiClient.parameterToPair("status", status)); Map localVarHeaderParams = new HashMap(); @@ -349,19 +381,26 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "petstore_auth" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call findPetsByStatusValidateBeforeCall(List status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'status' is set if (status == null) { throw new ApiException("Missing the required parameter 'status' when calling findPetsByStatus(Async)"); } - + com.squareup.okhttp.Call call = findPetsByStatusCall(status, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -370,6 +409,7 @@ private com.squareup.okhttp.Call findPetsByStatusValidateBeforeCall(List * @param status Status values that need to be considered for filter (required) * @return List<Pet> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public List findPetsByStatus(List status) throws ApiException { ApiResponse> resp = findPetsByStatusWithHttpInfo(status); @@ -382,6 +422,7 @@ public List findPetsByStatus(List status) throws ApiException { * @param status Status values that need to be considered for filter (required) * @return ApiResponse<List<Pet>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { com.squareup.okhttp.Call call = findPetsByStatusValidateBeforeCall(status, null, null); @@ -396,6 +437,7 @@ public ApiResponse> findPetsByStatusWithHttpInfo(List status) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call findPetsByStatusAsync(List status, final ApiCallback> callback) throws ApiException { @@ -423,6 +465,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for findPetsByTags * @param tags Tags to filter by (required) @@ -430,19 +473,18 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object - * @deprecated + */ - @Deprecated public com.squareup.okhttp.Call findPetsByTagsCall(List tags, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/pet/findByTags"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); if (tags != null) - localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags)); + localVarQueryParams.addAll(apiClient.parameterToPair("tags", tags)); Map localVarHeaderParams = new HashMap(); @@ -475,20 +517,26 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "petstore_auth" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - - @Deprecated + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call findPetsByTagsValidateBeforeCall(List tags, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'tags' is set if (tags == null) { throw new ApiException("Missing the required parameter 'tags' when calling findPetsByTags(Async)"); } - + com.squareup.okhttp.Call call = findPetsByTagsCall(tags, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -497,9 +545,8 @@ private com.squareup.okhttp.Call findPetsByTagsValidateBeforeCall(List t * @param tags Tags to filter by (required) * @return List<Pet> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @deprecated + */ - @Deprecated public List findPetsByTags(List tags) throws ApiException { ApiResponse> resp = findPetsByTagsWithHttpInfo(tags); return resp.getData(); @@ -511,9 +558,8 @@ public List findPetsByTags(List tags) throws ApiException { * @param tags Tags to filter by (required) * @return ApiResponse<List<Pet>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @deprecated + */ - @Deprecated public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { com.squareup.okhttp.Call call = findPetsByTagsValidateBeforeCall(tags, null, null); Type localVarReturnType = new TypeToken>(){}.getType(); @@ -527,9 +573,8 @@ public ApiResponse> findPetsByTagsWithHttpInfo(List tags) thro * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @deprecated + */ - @Deprecated public com.squareup.okhttp.Call findPetsByTagsAsync(List tags, final ApiCallback> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; @@ -556,6 +601,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for getPetById * @param petId ID of pet to return (required) @@ -563,10 +609,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call getPetByIdCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + public com.squareup.okhttp.Call getPetByIdCall(Integer petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); @@ -605,19 +652,26 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "api_key" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getPetByIdValidateBeforeCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call getPetByIdValidateBeforeCall(Integer petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling getPetById(Async)"); } - + com.squareup.okhttp.Call call = getPetByIdCall(petId, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -626,8 +680,9 @@ private com.squareup.okhttp.Call getPetByIdValidateBeforeCall(Long petId, final * @param petId ID of pet to return (required) * @return Pet * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public Pet getPetById(Long petId) throws ApiException { + public Pet getPetById(Integer petId) throws ApiException { ApiResponse resp = getPetByIdWithHttpInfo(petId); return resp.getData(); } @@ -638,8 +693,9 @@ public Pet getPetById(Long petId) throws ApiException { * @param petId ID of pet to return (required) * @return ApiResponse<Pet> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { + public ApiResponse getPetByIdWithHttpInfo(Integer petId) throws ApiException { com.squareup.okhttp.Call call = getPetByIdValidateBeforeCall(petId, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); @@ -652,8 +708,9 @@ public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call getPetByIdAsync(Long petId, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call getPetByIdAsync(Integer petId, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -679,17 +736,19 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for updatePet - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call updatePetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - + public com.squareup.okhttp.Call updatePetCall(Pet pet, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = pet; + // create path and map variables String localVarPath = "/pet"; @@ -701,7 +760,7 @@ public com.squareup.okhttp.Call updatePetCall(Pet body, final ProgressResponseBo Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -727,52 +786,62 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "petstore_auth" }; return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call updatePetValidateBeforeCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call updatePetValidateBeforeCall(Pet pet, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling updatePet(Async)"); + + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException("Missing the required parameter 'pet' when calling updatePet(Async)"); } - - com.squareup.okhttp.Call call = updatePetCall(body, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = updatePetCall(pet, progressListener, progressRequestListener); return call; + + + + + + } /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public void updatePet(Pet body) throws ApiException { - updatePetWithHttpInfo(body); + public void updatePet(Pet pet) throws ApiException { + updatePetWithHttpInfo(pet); } /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse updatePetWithHttpInfo(Pet body) throws ApiException { - com.squareup.okhttp.Call call = updatePetValidateBeforeCall(body, null, null); + public ApiResponse updatePetWithHttpInfo(Pet pet) throws ApiException { + com.squareup.okhttp.Call call = updatePetValidateBeforeCall(pet, null, null); return apiClient.execute(call); } /** * Update an existing pet (asynchronously) * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call updatePetAsync(Pet body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call updatePetAsync(Pet pet, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -793,23 +862,24 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = updatePetValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = updatePetValidateBeforeCall(pet, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } + /** * Build call for updatePetWithForm * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) + * @param body (optional) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call updatePetWithFormCall(Long petId, String name, String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - + public com.squareup.okhttp.Call updatePetWithFormCall(Integer petId, Object body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + // create path and map variables String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); @@ -820,13 +890,9 @@ public com.squareup.okhttp.Call updatePetWithFormCall(Long petId, String name, S 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); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -852,44 +918,51 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "petstore_auth" }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call updatePetWithFormValidateBeforeCall(Long petId, String name, String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call updatePetWithFormValidateBeforeCall(Integer petId, Object body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling updatePetWithForm(Async)"); } - - com.squareup.okhttp.Call call = updatePetWithFormCall(petId, name, status, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = updatePetWithFormCall(petId, body, progressListener, progressRequestListener); return call; + + + + + + } /** * 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 fail to call the API, e.g. server error or cannot deserialize the response body + */ - public void updatePetWithForm(Long petId, String name, String status) throws ApiException { - updatePetWithFormWithHttpInfo(petId, name, status); + public void updatePetWithForm(Integer petId, Object body) throws ApiException { + updatePetWithFormWithHttpInfo(petId, body); } /** * 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 ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { - com.squareup.okhttp.Call call = updatePetWithFormValidateBeforeCall(petId, name, status, null, null); + public ApiResponse updatePetWithFormWithHttpInfo(Integer petId, Object body) throws ApiException { + com.squareup.okhttp.Call call = updatePetWithFormValidateBeforeCall(petId, body, null, null); return apiClient.execute(call); } @@ -897,13 +970,13 @@ public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, * Updates a pet in the store with form data (asynchronously) * * @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 callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call updatePetWithFormAsync(Long petId, String name, String status, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call updatePetWithFormAsync(Integer petId, Object body, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -924,23 +997,24 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = updatePetWithFormValidateBeforeCall(petId, name, status, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = updatePetWithFormValidateBeforeCall(petId, body, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } + /** * Build call for uploadFile * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) + * @param body (optional) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - + public com.squareup.okhttp.Call uploadFileCall(Integer petId, Object body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + // create path and map variables String localVarPath = "/pet/{petId}/uploadImage" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); @@ -951,10 +1025,6 @@ public com.squareup.okhttp.Call uploadFileCall(Long petId, String additionalMeta 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" @@ -983,32 +1053,39 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "petstore_auth" }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call uploadFileValidateBeforeCall(Long petId, String additionalMetadata, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call uploadFileValidateBeforeCall(Integer petId, Object body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling uploadFile(Async)"); } - - com.squareup.okhttp.Call call = uploadFileCall(petId, additionalMetadata, file, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = uploadFileCall(petId, body, progressListener, progressRequestListener); return call; + + + + + + } /** * 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 fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException { - ApiResponse resp = uploadFileWithHttpInfo(petId, additionalMetadata, file); + public ModelApiResponse uploadFile(Integer petId, Object body) throws ApiException { + ApiResponse resp = uploadFileWithHttpInfo(petId, body); return resp.getData(); } @@ -1016,13 +1093,13 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f * 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 ApiResponse<ModelApiResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException { - com.squareup.okhttp.Call call = uploadFileValidateBeforeCall(petId, additionalMetadata, file, null, null); + public ApiResponse uploadFileWithHttpInfo(Integer petId, Object body) throws ApiException { + com.squareup.okhttp.Call call = uploadFileValidateBeforeCall(petId, body, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -1031,13 +1108,13 @@ public ApiResponse uploadFileWithHttpInfo(Long petId, String a * uploads an image (asynchronously) * * @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 callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call uploadFileAsync(Long petId, String additionalMetadata, File file, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call uploadFileAsync(Integer petId, Object body, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1058,9 +1135,10 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = uploadFileValidateBeforeCall(petId, additionalMetadata, file, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = uploadFileValidateBeforeCall(petId, body, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } + } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/StoreApi.java index a517a459d79..768543d365d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/StoreApi.java @@ -22,19 +22,26 @@ import io.swagger.client.ProgressRequestBody; import io.swagger.client.ProgressResponseBody; + import com.google.gson.reflect.TypeToken; import java.io.IOException; + + import io.swagger.client.model.Order; + import java.lang.reflect.Type; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class StoreApi { private ApiClient apiClient; @@ -54,6 +61,7 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * Build call for deleteOrder * @param orderId ID of the order that needs to be deleted (required) @@ -61,10 +69,11 @@ public void setApiClient(ApiClient apiClient) { * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call deleteOrderCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/store/order/{order_id}" .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); @@ -77,7 +86,7 @@ public com.squareup.okhttp.Call deleteOrderCall(String orderId, final ProgressRe Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -103,19 +112,26 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call deleteOrderValidateBeforeCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'orderId' is set if (orderId == null) { throw new ApiException("Missing the required parameter 'orderId' when calling deleteOrder(Async)"); } - + com.squareup.okhttp.Call call = deleteOrderCall(orderId, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -123,6 +139,7 @@ private com.squareup.okhttp.Call deleteOrderValidateBeforeCall(String orderId, f * 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 fail to call the API, e.g. server error or cannot deserialize the response body + */ public void deleteOrder(String orderId) throws ApiException { deleteOrderWithHttpInfo(orderId); @@ -134,6 +151,7 @@ public void deleteOrder(String orderId) throws ApiException { * @param orderId ID of the order that needs to be deleted (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { com.squareup.okhttp.Call call = deleteOrderValidateBeforeCall(orderId, null, null); @@ -147,6 +165,7 @@ public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiExcep * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call deleteOrderAsync(String orderId, final ApiCallback callback) throws ApiException { @@ -173,16 +192,18 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, callback); return call; } + /** * Build call for getInventory * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call getInventoryCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/store/inventory"; @@ -220,14 +241,21 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "api_key" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call getInventoryValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - + + com.squareup.okhttp.Call call = getInventoryCall(progressListener, progressRequestListener); return call; + + + + + + } /** @@ -235,6 +263,7 @@ private com.squareup.okhttp.Call getInventoryValidateBeforeCall(final ProgressRe * Returns a map of status codes to quantities * @return Map<String, Integer> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public Map getInventory() throws ApiException { ApiResponse> resp = getInventoryWithHttpInfo(); @@ -246,6 +275,7 @@ public Map getInventory() throws ApiException { * Returns a map of status codes to quantities * @return ApiResponse<Map<String, Integer>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse> getInventoryWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getInventoryValidateBeforeCall(null, null); @@ -259,6 +289,7 @@ public ApiResponse> getInventoryWithHttpInfo() throws ApiEx * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call getInventoryAsync(final ApiCallback> callback) throws ApiException { @@ -286,6 +317,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for getOrderById * @param orderId ID of pet that needs to be fetched (required) @@ -293,10 +325,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call getOrderByIdCall(Long orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + public com.squareup.okhttp.Call getOrderByIdCall(Integer orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/store/order/{order_id}" .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); @@ -335,19 +368,26 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getOrderByIdValidateBeforeCall(Long orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call getOrderByIdValidateBeforeCall(Integer orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'orderId' is set if (orderId == null) { throw new ApiException("Missing the required parameter 'orderId' when calling getOrderById(Async)"); } - + com.squareup.okhttp.Call call = getOrderByIdCall(orderId, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -356,8 +396,9 @@ private com.squareup.okhttp.Call getOrderByIdValidateBeforeCall(Long orderId, fi * @param orderId ID of pet that needs to be fetched (required) * @return Order * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public Order getOrderById(Long orderId) throws ApiException { + public Order getOrderById(Integer orderId) throws ApiException { ApiResponse resp = getOrderByIdWithHttpInfo(orderId); return resp.getData(); } @@ -368,8 +409,9 @@ public Order getOrderById(Long orderId) throws ApiException { * @param orderId ID of pet that needs to be fetched (required) * @return ApiResponse<Order> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { + public ApiResponse getOrderByIdWithHttpInfo(Integer orderId) throws ApiException { com.squareup.okhttp.Call call = getOrderByIdValidateBeforeCall(orderId, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); @@ -382,8 +424,9 @@ public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiExcep * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call getOrderByIdAsync(Long orderId, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call getOrderByIdAsync(Integer orderId, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -409,17 +452,19 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for placeOrder - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call placeOrderCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - + public com.squareup.okhttp.Call placeOrderCall(Order order, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = order; + // create path and map variables String localVarPath = "/store/order"; @@ -437,7 +482,7 @@ public com.squareup.okhttp.Call placeOrderCall(Order body, final ProgressRespons if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -457,42 +502,51 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call placeOrderValidateBeforeCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call placeOrderValidateBeforeCall(Order order, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling placeOrder(Async)"); + // verify the required parameter 'order' is set + if (order == null) { + throw new ApiException("Missing the required parameter 'order' when calling placeOrder(Async)"); } - - com.squareup.okhttp.Call call = placeOrderCall(body, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = placeOrderCall(order, progressListener, progressRequestListener); return call; + + + + + + } /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return Order * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public Order placeOrder(Order body) throws ApiException { - ApiResponse resp = placeOrderWithHttpInfo(body); + public Order placeOrder(Order order) throws ApiException { + ApiResponse resp = placeOrderWithHttpInfo(order); return resp.getData(); } /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return ApiResponse<Order> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse placeOrderWithHttpInfo(Order body) throws ApiException { - com.squareup.okhttp.Call call = placeOrderValidateBeforeCall(body, null, null); + public ApiResponse placeOrderWithHttpInfo(Order order) throws ApiException { + com.squareup.okhttp.Call call = placeOrderValidateBeforeCall(order, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -500,12 +554,13 @@ public ApiResponse placeOrderWithHttpInfo(Order body) throws ApiException /** * Place an order for a pet (asynchronously) * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call placeOrderAsync(Order body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call placeOrderAsync(Order order, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -526,9 +581,10 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = placeOrderValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = placeOrderValidateBeforeCall(order, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } + } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/UserApi.java index d0f16373bec..971b2f095f3 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/api/UserApi.java @@ -22,19 +22,26 @@ import io.swagger.client.ProgressRequestBody; import io.swagger.client.ProgressResponseBody; + import com.google.gson.reflect.TypeToken; import java.io.IOException; + + import io.swagger.client.model.User; + import java.lang.reflect.Type; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class UserApi { private ApiClient apiClient; @@ -54,17 +61,19 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * Build call for createUser - * @param body Created user object (required) + * @param user Created user object (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call createUserCall(User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - + public com.squareup.okhttp.Call createUserCall(User user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = user; + // create path and map variables String localVarPath = "/user"; @@ -76,13 +85,13 @@ public com.squareup.okhttp.Call createUserCall(User body, final ProgressResponse Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -102,52 +111,62 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call createUserValidateBeforeCall(User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call createUserValidateBeforeCall(User user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling createUser(Async)"); + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling createUser(Async)"); } - - com.squareup.okhttp.Call call = createUserCall(body, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = createUserCall(user, progressListener, progressRequestListener); return call; + + + + + + } /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public void createUser(User body) throws ApiException { - createUserWithHttpInfo(body); + public void createUser(User user) throws ApiException { + createUserWithHttpInfo(user); } /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse createUserWithHttpInfo(User body) throws ApiException { - com.squareup.okhttp.Call call = createUserValidateBeforeCall(body, null, null); + public ApiResponse createUserWithHttpInfo(User user) throws ApiException { + com.squareup.okhttp.Call call = createUserValidateBeforeCall(user, null, null); return apiClient.execute(call); } /** * Create user (asynchronously) * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call createUserAsync(User body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call createUserAsync(User user, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -168,10 +187,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = createUserValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = createUserValidateBeforeCall(user, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } + /** * Build call for createUsersWithArrayInput * @param body List of user object (required) @@ -179,10 +199,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call createUsersWithArrayInputCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; - + // create path and map variables String localVarPath = "/user/createWithArray"; @@ -194,13 +215,13 @@ public com.squareup.okhttp.Call createUsersWithArrayInputCall(List body, f Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -220,19 +241,26 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call createUsersWithArrayInputValidateBeforeCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling createUsersWithArrayInput(Async)"); } - + com.squareup.okhttp.Call call = createUsersWithArrayInputCall(body, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -240,6 +268,7 @@ private com.squareup.okhttp.Call createUsersWithArrayInputValidateBeforeCall(Lis * * @param body List of user object (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public void createUsersWithArrayInput(List body) throws ApiException { createUsersWithArrayInputWithHttpInfo(body); @@ -251,6 +280,7 @@ public void createUsersWithArrayInput(List body) throws ApiException { * @param body List of user object (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse createUsersWithArrayInputWithHttpInfo(List body) throws ApiException { com.squareup.okhttp.Call call = createUsersWithArrayInputValidateBeforeCall(body, null, null); @@ -264,6 +294,7 @@ public ApiResponse createUsersWithArrayInputWithHttpInfo(List body) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call createUsersWithArrayInputAsync(List body, final ApiCallback callback) throws ApiException { @@ -290,6 +321,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, callback); return call; } + /** * Build call for createUsersWithListInput * @param body List of user object (required) @@ -297,10 +329,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call createUsersWithListInputCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; - + // create path and map variables String localVarPath = "/user/createWithList"; @@ -312,13 +345,13 @@ public com.squareup.okhttp.Call createUsersWithListInputCall(List body, fi Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -338,19 +371,26 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call createUsersWithListInputValidateBeforeCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling createUsersWithListInput(Async)"); } - + com.squareup.okhttp.Call call = createUsersWithListInputCall(body, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -358,6 +398,7 @@ private com.squareup.okhttp.Call createUsersWithListInputValidateBeforeCall(List * * @param body List of user object (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public void createUsersWithListInput(List body) throws ApiException { createUsersWithListInputWithHttpInfo(body); @@ -369,6 +410,7 @@ public void createUsersWithListInput(List body) throws ApiException { * @param body List of user object (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse createUsersWithListInputWithHttpInfo(List body) throws ApiException { com.squareup.okhttp.Call call = createUsersWithListInputValidateBeforeCall(body, null, null); @@ -382,6 +424,7 @@ public ApiResponse createUsersWithListInputWithHttpInfo(List body) t * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call createUsersWithListInputAsync(List body, final ApiCallback callback) throws ApiException { @@ -408,6 +451,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, callback); return call; } + /** * Build call for deleteUser * @param username The name that needs to be deleted (required) @@ -415,10 +459,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call deleteUserCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); @@ -431,7 +476,7 @@ public com.squareup.okhttp.Call deleteUserCall(String username, final ProgressRe Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -457,19 +502,26 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call deleteUserValidateBeforeCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling deleteUser(Async)"); } - + com.squareup.okhttp.Call call = deleteUserCall(username, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -477,6 +529,7 @@ private com.squareup.okhttp.Call deleteUserValidateBeforeCall(String username, f * This can only be done by the logged in user. * @param username The name that needs to be deleted (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public void deleteUser(String username) throws ApiException { deleteUserWithHttpInfo(username); @@ -488,6 +541,7 @@ public void deleteUser(String username) throws ApiException { * @param username The name that needs to be deleted (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { com.squareup.okhttp.Call call = deleteUserValidateBeforeCall(username, null, null); @@ -501,6 +555,7 @@ public ApiResponse deleteUserWithHttpInfo(String username) throws ApiExcep * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call deleteUserAsync(String username, final ApiCallback callback) throws ApiException { @@ -527,6 +582,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, callback); return call; } + /** * Build call for getUserByName * @param username The name that needs to be fetched. Use user1 for testing. (required) @@ -534,10 +590,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call getUserByNameCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); @@ -576,19 +633,26 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call getUserByNameValidateBeforeCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling getUserByName(Async)"); } - + com.squareup.okhttp.Call call = getUserByNameCall(username, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -597,6 +661,7 @@ private com.squareup.okhttp.Call getUserByNameValidateBeforeCall(String username * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return User * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public User getUserByName(String username) throws ApiException { ApiResponse resp = getUserByNameWithHttpInfo(username); @@ -609,6 +674,7 @@ public User getUserByName(String username) throws ApiException { * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return ApiResponse<User> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { com.squareup.okhttp.Call call = getUserByNameValidateBeforeCall(username, null, null); @@ -623,6 +689,7 @@ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiEx * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call getUserByNameAsync(String username, final ApiCallback callback) throws ApiException { @@ -650,6 +717,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for loginUser * @param username The user name for login (required) @@ -658,10 +726,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call loginUserCall(String username, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/user/login"; @@ -703,10 +772,11 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call loginUserValidateBeforeCall(String username, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling loginUser(Async)"); @@ -717,10 +787,16 @@ private com.squareup.okhttp.Call loginUserValidateBeforeCall(String username, St throw new ApiException("Missing the required parameter 'password' when calling loginUser(Async)"); } - + com.squareup.okhttp.Call call = loginUserCall(username, password, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -730,6 +806,7 @@ private com.squareup.okhttp.Call loginUserValidateBeforeCall(String username, St * @param password The password for login in clear text (required) * @return String * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public String loginUser(String username, String password) throws ApiException { ApiResponse resp = loginUserWithHttpInfo(username, password); @@ -743,6 +820,7 @@ public String loginUser(String username, String password) throws ApiException { * @param password The password for login in clear text (required) * @return ApiResponse<String> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { com.squareup.okhttp.Call call = loginUserValidateBeforeCall(username, password, null, null); @@ -758,6 +836,7 @@ public ApiResponse loginUserWithHttpInfo(String username, String passwor * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call loginUserAsync(String username, String password, final ApiCallback callback) throws ApiException { @@ -785,16 +864,18 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for logoutUser * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call logoutUserCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/user/logout"; @@ -806,7 +887,7 @@ public com.squareup.okhttp.Call logoutUserCall(final ProgressResponseBody.Progre Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -832,20 +913,28 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call logoutUserValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - + + com.squareup.okhttp.Call call = logoutUserCall(progressListener, progressRequestListener); return call; + + + + + + } /** * Logs out current logged in user session * * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public void logoutUser() throws ApiException { logoutUserWithHttpInfo(); @@ -856,6 +945,7 @@ public void logoutUser() throws ApiException { * * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse logoutUserWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = logoutUserValidateBeforeCall(null, null); @@ -868,6 +958,7 @@ public ApiResponse logoutUserWithHttpInfo() throws ApiException { * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call logoutUserAsync(final ApiCallback callback) throws ApiException { @@ -894,18 +985,20 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, callback); return call; } + /** * Build call for updateUser + * @param user Updated user object (required) * @param username name that need to be deleted (required) - * @param body Updated user object (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call updateUserCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - + public com.squareup.okhttp.Call updateUserCall(User user, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = user; + // create path and map variables String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); @@ -918,13 +1011,13 @@ public com.squareup.okhttp.Call updateUserCall(String username, User body, final Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -944,60 +1037,70 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call updateUserValidateBeforeCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call updateUserValidateBeforeCall(User user, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling updateUser(Async)"); + } // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling updateUser(Async)"); } - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling updateUser(Async)"); - } - - com.squareup.okhttp.Call call = updateUserCall(username, body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = updateUserCall(user, username, progressListener, progressRequestListener); return call; + + + + + + } /** * 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 fail to call the API, e.g. server error or cannot deserialize the response body + */ - public void updateUser(String username, User body) throws ApiException { - updateUserWithHttpInfo(username, body); + public void updateUser(User user, String username) throws ApiException { + updateUserWithHttpInfo(user, username); } /** * 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 ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse updateUserWithHttpInfo(String username, User body) throws ApiException { - com.squareup.okhttp.Call call = updateUserValidateBeforeCall(username, body, null, null); + public ApiResponse updateUserWithHttpInfo(User user, String username) throws ApiException { + com.squareup.okhttp.Call call = updateUserValidateBeforeCall(user, username, null, null); return apiClient.execute(call); } /** * Updated user (asynchronously) * 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 callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call updateUserAsync(String username, User body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call updateUserAsync(User user, String username, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1018,8 +1121,9 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = updateUserValidateBeforeCall(username, body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = updateUserValidateBeforeCall(user, username, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } + } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index b6ccfc43902..65aa1880336 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -32,66 +32,64 @@ * AdditionalPropertiesClass */ -public class AdditionalPropertiesClass implements Parcelable { - @SerializedName("map_property") +public class AdditionalPropertiesClass { +@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) { @@ -109,8 +107,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapProperty, mapOfMapProperty); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -133,11 +130,12 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(mapProperty); - out.writeValue(mapOfMapProperty); + } public AdditionalPropertiesClass() { @@ -146,8 +144,7 @@ public AdditionalPropertiesClass() { AdditionalPropertiesClass(Parcel in) { - mapProperty = (Map)in.readValue(null); - mapOfMapProperty = (Map>)in.readValue(Map.class.getClassLoader()); + mapProperty = (Map)in.readValue(null);mapOfMapProperty = (Map>)in.readValue(Map.class.getClassLoader()); } public int describeContents() { @@ -164,3 +161,5 @@ public AdditionalPropertiesClass[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Animal.java index 89ddcdc99ec..a5bacb0b06e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Animal.java @@ -30,50 +30,48 @@ */ -public class Animal implements Parcelable { - @SerializedName("className") +public class Animal { +@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) { @@ -91,8 +89,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(className, color); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -115,11 +112,12 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(className); - out.writeValue(color); + } public Animal() { @@ -128,8 +126,7 @@ public Animal() { Animal(Parcel in) { - className = (String)in.readValue(null); - color = (String)in.readValue(null); + className = (String)in.readValue(null);color = (String)in.readValue(null); } public int describeContents() { @@ -146,3 +143,5 @@ public Animal[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AnimalFarm.java deleted file mode 100644 index a844db02e09..00000000000 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/AnimalFarm.java +++ /dev/null @@ -1,90 +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 android.os.Parcelable; -import android.os.Parcel; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList implements Parcelable { - - @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 "); - } - - public void writeToParcel(Parcel out, int flags) { - super.writeToParcel(out, flags); } - - public AnimalFarm() { - super(); - } - - AnimalFarm(Parcel in) { - super(in); - } - - public int describeContents() { - return 0; - } - - public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { - public AnimalFarm createFromParcel(Parcel in) { - return new AnimalFarm(in); - } - public AnimalFarm[] newArray(int size) { - return new AnimalFarm[size]; - } - }; -} - diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index cdaf9bf9d11..c133a67dbf4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -32,37 +32,37 @@ * ArrayOfArrayOfNumberOnly */ -public class ArrayOfArrayOfNumberOnly implements Parcelable { - @SerializedName("ArrayArrayNumber") +public class ArrayOfArrayOfNumberOnly { +@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) { @@ -79,8 +79,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayArrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -102,9 +101,11 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(arrayArrayNumber); + } public ArrayOfArrayOfNumberOnly() { @@ -130,3 +131,5 @@ public ArrayOfArrayOfNumberOnly[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 31235c82a66..3ef610b38bb 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -32,37 +32,37 @@ * ArrayOfNumberOnly */ -public class ArrayOfNumberOnly implements Parcelable { - @SerializedName("ArrayNumber") +public class ArrayOfNumberOnly { +@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) { @@ -79,8 +79,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(arrayNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -102,9 +101,11 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(arrayNumber); + } public ArrayOfNumberOnly() { @@ -130,3 +131,5 @@ public ArrayOfNumberOnly[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayTest.java index a8a208ede45..570323146d4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ArrayTest.java @@ -32,95 +32,95 @@ * ArrayTest */ -public class ArrayTest implements Parcelable { - @SerializedName("array_of_string") +public class ArrayTest { +@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) { @@ -139,8 +139,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(); @@ -164,13 +163,13 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(arrayOfString); - out.writeValue(arrayArrayOfInteger); - out.writeValue(arrayArrayOfModel); + } public ArrayTest() { @@ -179,9 +178,7 @@ public ArrayTest() { ArrayTest(Parcel in) { - arrayOfString = (List)in.readValue(null); - arrayArrayOfInteger = (List>)in.readValue(List.class.getClassLoader()); - arrayArrayOfModel = (List>)in.readValue(List.class.getClassLoader()); + arrayOfString = (List)in.readValue(null);arrayArrayOfInteger = (List>)in.readValue(List.class.getClassLoader());arrayArrayOfModel = (List>)in.readValue(List.class.getClassLoader()); } public int describeContents() { @@ -198,3 +195,5 @@ public ArrayTest[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Capitalization.java index 01fdd9ca963..478a99e0e4b 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Capitalization.java @@ -29,134 +29,128 @@ * Capitalization */ -public class Capitalization implements Parcelable { - @SerializedName("smallCamel") +public class Capitalization { +@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) { @@ -178,8 +172,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(); @@ -206,19 +199,16 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(smallCamel); - out.writeValue(capitalCamel); - out.writeValue(smallSnake); - out.writeValue(capitalSnake); - out.writeValue(scAETHFlowPoints); - out.writeValue(ATT_NAME); + } public Capitalization() { @@ -227,12 +217,7 @@ public Capitalization() { Capitalization(Parcel in) { - smallCamel = (String)in.readValue(null); - capitalCamel = (String)in.readValue(null); - smallSnake = (String)in.readValue(null); - capitalSnake = (String)in.readValue(null); - scAETHFlowPoints = (String)in.readValue(null); - ATT_NAME = (String)in.readValue(null); + smallCamel = (String)in.readValue(null);capitalCamel = (String)in.readValue(null);smallSnake = (String)in.readValue(null);capitalSnake = (String)in.readValue(null);scAETHFlowPoints = (String)in.readValue(null);ATT_NAME = (String)in.readValue(null); } public int describeContents() { @@ -249,3 +234,5 @@ public Capitalization[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Cat.java index 5fdb74cbd1e..a145224150a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Cat.java @@ -30,29 +30,68 @@ * Cat */ -public class Cat extends Animal implements Parcelable { +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) { @@ -62,21 +101,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(); @@ -93,9 +135,13 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - super.writeToParcel(out, flags); + super.writeToParcel(out, flags); + out.writeValue(className); + out.writeValue(color); out.writeValue(declawed); + } public Cat() { @@ -104,7 +150,7 @@ public Cat() { Cat(Parcel in) { super(in); - declawed = (Boolean)in.readValue(null); + className = (String)in.readValue(null);color = (String)in.readValue(null);declawed = (Boolean)in.readValue(null); } public int describeContents() { @@ -121,3 +167,5 @@ public Cat[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Category.java index 9a604aa8227..ebb79cdc945 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Category.java @@ -29,50 +29,48 @@ * Category */ -public class Category implements Parcelable { - @SerializedName("id") +public class Category { +@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) { @@ -90,8 +88,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -114,11 +111,12 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(id); - out.writeValue(name); + } public Category() { @@ -127,8 +125,7 @@ public Category() { Category(Parcel in) { - id = (Long)in.readValue(null); - name = (String)in.readValue(null); + id = (Long)in.readValue(null);name = (String)in.readValue(null); } public int describeContents() { @@ -145,3 +142,5 @@ public Category[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ClassModel.java index 6cc1bac7b54..cb95b432263 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ClassModel.java @@ -27,32 +27,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 implements Parcelable { - @SerializedName("_class") +public class ClassModel { +@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) { @@ -69,8 +67,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -92,9 +89,11 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(propertyClass); + } public ClassModel() { @@ -120,3 +119,5 @@ public ClassModel[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Client.java index 1b73505df83..0ab6989bfc5 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Client.java @@ -29,29 +29,28 @@ * Client */ -public class Client implements Parcelable { - @SerializedName("client") +public class 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) { @@ -68,8 +67,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(client); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -91,9 +89,11 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(client); + } public Client() { @@ -119,3 +119,5 @@ public Client[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Dog.java index e6afcc17e57..11da71f8986 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Dog.java @@ -30,29 +30,68 @@ * Dog */ -public class Dog extends Animal implements Parcelable { +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) { @@ -62,21 +101,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(); @@ -93,9 +135,13 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - super.writeToParcel(out, flags); + super.writeToParcel(out, flags); + out.writeValue(className); + out.writeValue(color); out.writeValue(breed); + } public Dog() { @@ -104,7 +150,7 @@ public Dog() { Dog(Parcel in) { super(in); - breed = (String)in.readValue(null); + className = (String)in.readValue(null);color = (String)in.readValue(null);breed = (String)in.readValue(null); } public int describeContents() { @@ -121,3 +167,5 @@ public Dog[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumArrays.java index 0bf8c81509b..43efdb3c5f9 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumArrays.java @@ -31,14 +31,15 @@ * EnumArrays */ -public class EnumArrays implements Parcelable { - /** +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; @@ -46,7 +47,7 @@ public enum JustSymbolEnum { JustSymbolEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -55,7 +56,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)) { @@ -64,7 +65,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 { @@ -78,17 +79,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; @@ -96,7 +98,7 @@ public enum ArrayEnumEnum { ArrayEnumEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -105,7 +107,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)) { @@ -114,7 +116,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 { @@ -128,55 +130,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) { @@ -194,8 +195,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justSymbol, arrayEnum); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -218,11 +218,12 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(justSymbol); - out.writeValue(arrayEnum); + } public EnumArrays() { @@ -231,8 +232,7 @@ public EnumArrays() { EnumArrays(Parcel in) { - justSymbol = (JustSymbolEnum)in.readValue(null); - arrayEnum = (List)in.readValue(null); + justSymbol = (JustSymbolEnum)in.readValue(null);arrayEnum = (List)in.readValue(null); } public int describeContents() { @@ -249,3 +249,5 @@ public EnumArrays[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumClass.java index 6a3f3f26ac8..91b2759376e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumClass.java @@ -18,16 +18,21 @@ import android.os.Parcelable; import android.os.Parcel; + + 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"), @@ -42,6 +47,7 @@ public enum EnumClass { this.value = value; } + public String getValue() { return value; } @@ -51,6 +57,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)) { @@ -60,6 +67,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 { @@ -72,5 +80,8 @@ public EnumClass read(final JsonReader jsonReader) throws IOException { return EnumClass.fromValue(String.valueOf(value)); } } + } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumTest.java index 7740669efa2..b712a64b6ae 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumTest.java @@ -30,16 +30,16 @@ * EnumTest */ -public class EnumTest implements Parcelable { - /** +public class EnumTest { + + /** * Gets or Sets enumString */ @JsonAdapter(EnumStringEnum.Adapter.class) public enum EnumStringEnum { - UPPER("UPPER"), + UPPER("UPPER"), LOWER("lower"), - EMPTY(""); private String value; @@ -47,7 +47,7 @@ public enum EnumStringEnum { EnumStringEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -56,7 +56,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)) { @@ -65,7 +65,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 { @@ -79,17 +79,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; @@ -97,7 +97,7 @@ public enum EnumIntegerEnum { EnumIntegerEnum(Integer value) { this.value = value; } - + public Integer getValue() { return value; } @@ -106,7 +106,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)) { @@ -115,7 +115,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 { @@ -129,17 +129,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; @@ -147,7 +147,7 @@ public enum EnumNumberEnum { EnumNumberEnum(Double value) { this.value = value; } - + public Double getValue() { return value; } @@ -156,7 +156,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)) { @@ -165,7 +165,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 { @@ -179,86 +179,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) { @@ -278,8 +276,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(); @@ -304,15 +301,14 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(enumString); - out.writeValue(enumInteger); - out.writeValue(enumNumber); - out.writeValue(outerEnum); + } public EnumTest() { @@ -321,10 +317,7 @@ public EnumTest() { EnumTest(Parcel in) { - enumString = (EnumStringEnum)in.readValue(null); - enumInteger = (EnumIntegerEnum)in.readValue(null); - enumNumber = (EnumNumberEnum)in.readValue(null); - outerEnum = (OuterEnum)in.readValue(OuterEnum.class.getClassLoader()); + enumString = (EnumStringEnum)in.readValue(null);enumInteger = (EnumIntegerEnum)in.readValue(null);enumNumber = (EnumNumberEnum)in.readValue(null);outerEnum = (OuterEnum)in.readValue(OuterEnum.class.getClassLoader()); } public int describeContents() { @@ -341,3 +334,5 @@ public EnumTest[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/FormatTest.java index c9128a2a52b..6556119d20d 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/FormatTest.java @@ -33,291 +33,272 @@ * FormatTest */ -public class FormatTest implements Parcelable { - @SerializedName("integer") +public class FormatTest { +@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) { @@ -346,8 +327,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(); @@ -381,33 +361,23 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(integer); - out.writeValue(int32); - out.writeValue(int64); - out.writeValue(number); - out.writeValue(_float); - out.writeValue(_double); - out.writeValue(string); - out.writeValue(_byte); - out.writeValue(binary); - out.writeValue(date); - out.writeValue(dateTime); - out.writeValue(uuid); - out.writeValue(password); + } public FormatTest() { @@ -416,19 +386,7 @@ public FormatTest() { FormatTest(Parcel in) { - integer = (Integer)in.readValue(null); - int32 = (Integer)in.readValue(null); - int64 = (Long)in.readValue(null); - number = (BigDecimal)in.readValue(BigDecimal.class.getClassLoader()); - _float = (Float)in.readValue(null); - _double = (Double)in.readValue(null); - string = (String)in.readValue(null); - _byte = (byte[])in.readValue(null); - binary = (byte[])in.readValue(null); - date = (LocalDate)in.readValue(LocalDate.class.getClassLoader()); - dateTime = (OffsetDateTime)in.readValue(OffsetDateTime.class.getClassLoader()); - uuid = (UUID)in.readValue(UUID.class.getClassLoader()); - password = (String)in.readValue(null); + integer = (Integer)in.readValue(null);int32 = (Integer)in.readValue(null);int64 = (Long)in.readValue(null);number = (BigDecimal)in.readValue(BigDecimal.class.getClassLoader());_float = (Float)in.readValue(null);_double = (Double)in.readValue(null);string = (String)in.readValue(null);_byte = (String)in.readValue(null);binary = (String)in.readValue(null);date = (LocalDate)in.readValue(LocalDate.class.getClassLoader());dateTime = (OffsetDateTime)in.readValue(OffsetDateTime.class.getClassLoader());uuid = (UUID)in.readValue(UUID.class.getClassLoader());password = (String)in.readValue(null); } public int describeContents() { @@ -445,3 +403,5 @@ public FormatTest[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index f95ff9951f9..e1f0ae4da20 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -29,32 +29,32 @@ * HasOnlyReadOnly */ -public class HasOnlyReadOnly implements Parcelable { - @SerializedName("bar") +public class HasOnlyReadOnly { +@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) { @@ -72,8 +72,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, foo); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -96,11 +95,12 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(bar); - out.writeValue(foo); + } public HasOnlyReadOnly() { @@ -109,8 +109,7 @@ public HasOnlyReadOnly() { HasOnlyReadOnly(Parcel in) { - bar = (String)in.readValue(null); - foo = (String)in.readValue(null); + bar = (String)in.readValue(null);foo = (String)in.readValue(null); } public int describeContents() { @@ -127,3 +126,5 @@ public HasOnlyReadOnly[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MapTest.java index 079daa6d717..6fc9127f95c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MapTest.java @@ -32,17 +32,18 @@ * MapTest */ -public class MapTest implements Parcelable { - @SerializedName("map_map_of_string") +public class MapTest { +@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; @@ -50,7 +51,7 @@ public enum InnerEnum { InnerEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -59,7 +60,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)) { @@ -68,7 +69,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 { @@ -82,63 +83,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) { @@ -156,8 +155,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(mapMapOfString, mapOfEnumString); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -180,11 +178,12 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(mapMapOfString); - out.writeValue(mapOfEnumString); + } public MapTest() { @@ -193,8 +192,7 @@ public MapTest() { MapTest(Parcel in) { - mapMapOfString = (Map>)in.readValue(Map.class.getClassLoader()); - mapOfEnumString = (Map)in.readValue(null); + mapMapOfString = (Map>)in.readValue(Map.class.getClassLoader());mapOfEnumString = (Map)in.readValue(null); } public int describeContents() { @@ -211,3 +209,5 @@ public MapTest[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 345de387543..66a17c7776c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -35,79 +35,76 @@ * MixedPropertiesAndAdditionalPropertiesClass */ -public class MixedPropertiesAndAdditionalPropertiesClass implements Parcelable { - @SerializedName("uuid") +public class MixedPropertiesAndAdditionalPropertiesClass { +@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) { @@ -126,8 +123,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,13 +147,13 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(uuid); - out.writeValue(dateTime); - out.writeValue(map); + } public MixedPropertiesAndAdditionalPropertiesClass() { @@ -166,9 +162,7 @@ public MixedPropertiesAndAdditionalPropertiesClass() { MixedPropertiesAndAdditionalPropertiesClass(Parcel in) { - uuid = (UUID)in.readValue(UUID.class.getClassLoader()); - dateTime = (OffsetDateTime)in.readValue(OffsetDateTime.class.getClassLoader()); - map = (Map)in.readValue(Animal.class.getClassLoader()); + uuid = (UUID)in.readValue(UUID.class.getClassLoader());dateTime = (OffsetDateTime)in.readValue(OffsetDateTime.class.getClassLoader());map = (Map)in.readValue(Animal.class.getClassLoader()); } public int describeContents() { @@ -185,3 +179,5 @@ public MixedPropertiesAndAdditionalPropertiesClass[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Model200Response.java index fee0bdffb90..cbc1177c6c5 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Model200Response.java @@ -27,53 +27,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 implements Parcelable { - @SerializedName("name") +public class Model200Response { +@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) { @@ -91,8 +88,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(name, propertyClass); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -115,11 +111,12 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(name); - out.writeValue(propertyClass); + } public Model200Response() { @@ -128,8 +125,7 @@ public Model200Response() { Model200Response(Parcel in) { - name = (Integer)in.readValue(null); - propertyClass = (String)in.readValue(null); + name = (Integer)in.readValue(null);propertyClass = (String)in.readValue(null); } public int describeContents() { @@ -146,3 +142,5 @@ public Model200Response[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelApiResponse.java index 80bad00f37b..87d0292cfa8 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -29,71 +29,68 @@ * ModelApiResponse */ -public class ModelApiResponse implements Parcelable { - @SerializedName("code") +public class ModelApiResponse { +@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) { @@ -112,8 +109,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(); @@ -137,13 +133,13 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(code); - out.writeValue(type); - out.writeValue(message); + } public ModelApiResponse() { @@ -152,9 +148,7 @@ public ModelApiResponse() { ModelApiResponse(Parcel in) { - code = (Integer)in.readValue(null); - type = (String)in.readValue(null); - message = (String)in.readValue(null); + code = (Integer)in.readValue(null);type = (String)in.readValue(null);message = (String)in.readValue(null); } public int describeContents() { @@ -171,3 +165,5 @@ public ModelApiResponse[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelReturn.java index d1cb38fd7cb..656375f2171 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelReturn.java @@ -27,32 +27,30 @@ /** * Model for testing reserved words - */ -@ApiModel(description = "Model for testing reserved words") + */@ApiModel(description = "Model for testing reserved words") -public class ModelReturn implements Parcelable { - @SerializedName("return") +public class ModelReturn { +@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) { @@ -69,8 +67,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(_return); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -92,9 +89,11 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(_return); + } public ModelReturn() { @@ -120,3 +119,5 @@ public ModelReturn[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Name.java index 60cbdc3aa5d..dac8c40a393 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Name.java @@ -27,77 +27,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 implements Parcelable { - @SerializedName("name") +public class 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) { @@ -117,8 +114,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(); @@ -143,15 +139,14 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(name); - out.writeValue(snakeCase); - out.writeValue(property); - out.writeValue(_123Number); + } public Name() { @@ -160,10 +155,7 @@ public Name() { Name(Parcel in) { - name = (Integer)in.readValue(null); - snakeCase = (Integer)in.readValue(null); - property = (String)in.readValue(null); - _123Number = (Integer)in.readValue(null); + name = (Integer)in.readValue(null);snakeCase = (Integer)in.readValue(null);property = (String)in.readValue(null);_123Number = (Integer)in.readValue(null); } public int describeContents() { @@ -180,3 +172,5 @@ public Name[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/NumberOnly.java index 2b28fe9bf57..ba0cf43dbe2 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/NumberOnly.java @@ -30,29 +30,28 @@ * NumberOnly */ -public class NumberOnly implements Parcelable { - @SerializedName("JustNumber") +public class NumberOnly { +@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) { @@ -69,8 +68,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(justNumber); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -92,9 +90,11 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(justNumber); + } public NumberOnly() { @@ -120,3 +120,5 @@ public NumberOnly[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Order.java index 008233f13a9..4a88f3899bd 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Order.java @@ -30,28 +30,24 @@ * Order */ -public class Order implements Parcelable { - @SerializedName("id") +public class Order { +@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; @@ -59,7 +55,7 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -68,7 +64,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)) { @@ -77,7 +73,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 { @@ -91,122 +87,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) { @@ -228,8 +222,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,19 +249,16 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(id); - out.writeValue(petId); - out.writeValue(quantity); - out.writeValue(shipDate); - out.writeValue(status); - out.writeValue(complete); + } public Order() { @@ -277,12 +267,7 @@ public Order() { Order(Parcel in) { - id = (Long)in.readValue(null); - petId = (Long)in.readValue(null); - quantity = (Integer)in.readValue(null); - shipDate = (OffsetDateTime)in.readValue(OffsetDateTime.class.getClassLoader()); - status = (StatusEnum)in.readValue(null); - complete = (Boolean)in.readValue(null); + id = (Long)in.readValue(null);petId = (Long)in.readValue(null);quantity = (Integer)in.readValue(null);shipDate = (OffsetDateTime)in.readValue(OffsetDateTime.class.getClassLoader());status = (StatusEnum)in.readValue(null);complete = (Boolean)in.readValue(null); } public int describeContents() { @@ -299,3 +284,5 @@ public Order[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterComposite.java index cf9f2f1fc78..7c742c0e0e2 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterComposite.java @@ -30,71 +30,68 @@ * OuterComposite */ -public class OuterComposite implements Parcelable { - @SerializedName("my_number") +public class OuterComposite { +@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) { @@ -113,8 +110,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(); @@ -138,13 +134,13 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(myNumber); - out.writeValue(myString); - out.writeValue(myBoolean); + } public OuterComposite() { @@ -153,9 +149,7 @@ public OuterComposite() { OuterComposite(Parcel in) { - myNumber = (BigDecimal)in.readValue(BigDecimal.class.getClassLoader()); - myString = (String)in.readValue(null); - myBoolean = (Boolean)in.readValue(null); + myNumber = (BigDecimal)in.readValue(BigDecimal.class.getClassLoader());myString = (String)in.readValue(null);myBoolean = (Boolean)in.readValue(null); } public int describeContents() { @@ -172,3 +166,5 @@ public OuterComposite[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterEnum.java index ec924e9fa73..de909b312f6 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/OuterEnum.java @@ -18,16 +18,21 @@ import android.os.Parcelable; import android.os.Parcel; + + 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"), @@ -42,6 +47,7 @@ public enum OuterEnum { this.value = value; } + public String getValue() { return value; } @@ -51,6 +57,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)) { @@ -60,6 +67,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 { @@ -72,5 +80,8 @@ public OuterEnum read(final JsonReader jsonReader) throws IOException { return OuterEnum.fromValue(String.valueOf(value)); } } + } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Pet.java index 37bbf49875f..f6c4d4c4585 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Pet.java @@ -33,31 +33,26 @@ * Pet */ -public class Pet implements Parcelable { - @SerializedName("id") +public class Pet { +@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; @@ -65,7 +60,7 @@ public enum StatusEnum { StatusEnum(String value) { this.value = value; } - + public String getValue() { return value; } @@ -74,7 +69,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)) { @@ -83,7 +78,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 { @@ -97,132 +92,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) { @@ -244,8 +239,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(); @@ -272,19 +266,16 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(id); - out.writeValue(category); - out.writeValue(name); - out.writeValue(photoUrls); - out.writeValue(tags); - out.writeValue(status); + } public Pet() { @@ -293,12 +284,7 @@ public Pet() { Pet(Parcel in) { - id = (Long)in.readValue(null); - category = (Category)in.readValue(Category.class.getClassLoader()); - name = (String)in.readValue(null); - photoUrls = (List)in.readValue(null); - tags = (List)in.readValue(Tag.class.getClassLoader()); - status = (StatusEnum)in.readValue(null); + id = (Long)in.readValue(null);category = (Category)in.readValue(Category.class.getClassLoader());name = (String)in.readValue(null);photoUrls = (List)in.readValue(null);tags = (List)in.readValue(Tag.class.getClassLoader());status = (StatusEnum)in.readValue(null); } public int describeContents() { @@ -315,3 +301,5 @@ public Pet[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index d79499f240b..5ba0e011c8a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -29,41 +29,40 @@ * ReadOnlyFirst */ -public class ReadOnlyFirst implements Parcelable { - @SerializedName("bar") +public class ReadOnlyFirst { +@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) { @@ -81,8 +80,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(bar, baz); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -105,11 +103,12 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(bar); - out.writeValue(baz); + } public ReadOnlyFirst() { @@ -118,8 +117,7 @@ public ReadOnlyFirst() { ReadOnlyFirst(Parcel in) { - bar = (String)in.readValue(null); - baz = (String)in.readValue(null); + bar = (String)in.readValue(null);baz = (String)in.readValue(null); } public int describeContents() { @@ -136,3 +134,5 @@ public ReadOnlyFirst[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/SpecialModelName.java index c04c8185f20..94616dd3abe 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -29,29 +29,28 @@ * SpecialModelName */ -public class SpecialModelName implements Parcelable { - @SerializedName("$special[property.name]") - private Long specialPropertyName = null; - - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; +public class SpecialModelName { +@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) { @@ -60,22 +59,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(); } @@ -91,9 +89,11 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - - out.writeValue(specialPropertyName); + + out.writeValue($specialPropertyName); + } public SpecialModelName() { @@ -102,7 +102,7 @@ public SpecialModelName() { SpecialModelName(Parcel in) { - specialPropertyName = (Long)in.readValue(null); + $specialPropertyName = (Long)in.readValue(null); } public int describeContents() { @@ -119,3 +119,5 @@ public SpecialModelName[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Tag.java index 7557a6fbf34..53b9384e6a7 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Tag.java @@ -29,50 +29,48 @@ * Tag */ -public class Tag implements Parcelable { - @SerializedName("id") +public class Tag { +@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) { @@ -90,8 +88,7 @@ public boolean equals(java.lang.Object o) { public int hashCode() { return Objects.hash(id, name); } - - + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -114,11 +111,12 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(id); - out.writeValue(name); + } public Tag() { @@ -127,8 +125,7 @@ public Tag() { Tag(Parcel in) { - id = (Long)in.readValue(null); - name = (String)in.readValue(null); + id = (Long)in.readValue(null);name = (String)in.readValue(null); } public int describeContents() { @@ -145,3 +142,5 @@ public Tag[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/User.java index 0853d0673be..3d8b115d2b4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/User.java @@ -29,176 +29,168 @@ * User */ -public class User implements Parcelable { - @SerializedName("id") +public class User { +@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) { @@ -222,8 +214,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(); @@ -252,23 +243,18 @@ private String toIndentedString(java.lang.Object o) { return o.toString().replace("\n", "\n "); } + public void writeToParcel(Parcel out, int flags) { - + out.writeValue(id); - out.writeValue(username); - out.writeValue(firstName); - out.writeValue(lastName); - out.writeValue(email); - out.writeValue(password); - out.writeValue(phone); - out.writeValue(userStatus); + } public User() { @@ -277,14 +263,7 @@ public User() { User(Parcel in) { - id = (Long)in.readValue(null); - username = (String)in.readValue(null); - firstName = (String)in.readValue(null); - lastName = (String)in.readValue(null); - email = (String)in.readValue(null); - password = (String)in.readValue(null); - phone = (String)in.readValue(null); - userStatus = (Integer)in.readValue(null); + id = (Long)in.readValue(null);username = (String)in.readValue(null);firstName = (String)in.readValue(null);lastName = (String)in.readValue(null);email = (String)in.readValue(null);password = (String)in.readValue(null);phone = (String)in.readValue(null);userStatus = (Integer)in.readValue(null); } public int describeContents() { @@ -301,3 +280,5 @@ public User[] newArray(int size) { }; } + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java index a5339a392d2..f2b031f9485 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -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/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeApiTest.java index 169209bd418..9710cbe6764 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -16,17 +16,18 @@ import io.swagger.client.ApiException; 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.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; - DateTime 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,56 @@ 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 + } + + /** + * 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/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index af5885aaddd..dbda3faa692 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -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/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/PetApiTest.java index 349a55d93dc..f02c13872eb 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/PetApiTest.java @@ -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/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/StoreApiTest.java index bef0884a2da..c6d9b89f0bd 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -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/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/UserApiTest.java index 4455b3920b9..175f42fca9c 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/io/swagger/client/api/UserApiTest.java @@ -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/okhttp-gson/.swagger-codegen/VERSION b/samples/client/petstore/java/okhttp-gson/.swagger-codegen/VERSION index 50794f17f1a..096bf47efe3 100644 --- a/samples/client/petstore/java/okhttp-gson/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/okhttp-gson/.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/okhttp-gson/README.md b/samples/client/petstore/java/okhttp-gson/README.md index 541407fec8b..387f4090dca 100644 --- a/samples/client/petstore/java/okhttp-gson/README.md +++ b/samples/client/petstore/java/okhttp-gson/README.md @@ -61,30 +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.PetApi; +import io.swagger.client.api.AnotherFakeApi; import java.io.File; import java.util.*; -public class PetApiExample { +public class AnotherFakeApiExample { 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(); + AnotherFakeApi apiInstance = new AnotherFakeApi(); - Pet body = new Pet(); // Pet | Pet object that needs to be added to the store + Client client = ; // Client | client model try { - apiInstance.addPet(body); + Client result = apiInstance.testSpecialTags(client); + System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#addPet"); + System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); e.printStackTrace(); } } @@ -94,26 +91,32 @@ public class PetApiExample { ## 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* | [**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* | [**addPetUsingByteArray**](docs/PetApi.md#addPetUsingByteArray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding 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* | [**getPetByIdInObject**](docs/PetApi.md#getPetByIdInObject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID' -*PetApi* | [**petPetIdtestingByteArraytrueGet**](docs/PetApi.md#petPetIdtestingByteArraytrueGet) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by '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* | [**findOrdersByStatus**](docs/StoreApi.md#findOrdersByStatus) | **GET** /store/findByStatus | Finds orders by status +*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* | [**getInventoryInObject**](docs/StoreApi.md#getInventoryInObject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory' -*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 @@ -127,16 +130,34 @@ Class | Method | HTTP request | Description ## 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) - - [InlineResponse200](docs/InlineResponse200.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) @@ -145,53 +166,48 @@ Class | Method | HTTP request | Description ## Documentation for Authorization Authentication schemes defined for the API: -### 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 - -### test_api_client_id +### api_key - **Type**: API key -- **API key parameter name**: x-test_api_client_id +- **API key parameter name**: api_key - **Location**: HTTP header -### test_api_client_secret -- **Type**: API key -- **API key parameter name**: x-test_api_client_secret -- **Location**: HTTP header -### api_key + +### api_key_query - **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header +- **API key parameter name**: api_key_query +- **Location**: URL query string + + + + +### http_basic_test -### test_http_basic - **Type**: HTTP basic authentication -### test_api_key_query -- **Type**: API key -- **API key parameter name**: test_api_key_query -- **Location**: URL query string -### test_api_key_header +### petstore_auth + + + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - : + + -- **Type**: API key -- **API key parameter name**: test_api_key_header -- **Location**: HTTP header ## 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/okhttp-gson/build.gradle b/samples/client/petstore/java/okhttp-gson/build.gradle index c11d2e8f805..49d5c22cb54 100644 --- a/samples/client/petstore/java/okhttp-gson/build.gradle +++ b/samples/client/petstore/java/okhttp-gson/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 @@ -98,7 +101,9 @@ dependencies { compile 'com.squareup.okhttp:okhttp:2.7.5' compile 'com.squareup.okhttp:logging-interceptor:2.7.5' compile 'com.google.code.gson:gson:2.8.1' - compile 'io.gsonfire:gson-fire:1.8.0' + + compile 'org.threeten:threetenbp:1.3.5' + testCompile 'junit:junit:4.12' } diff --git a/samples/client/petstore/java/okhttp-gson/build.sbt b/samples/client/petstore/java/okhttp-gson/build.sbt index db083233db7..83d5c6b8d5d 100644 --- a/samples/client/petstore/java/okhttp-gson/build.sbt +++ b/samples/client/petstore/java/okhttp-gson/build.sbt @@ -13,8 +13,10 @@ lazy val root = (project in file(".")). "com.squareup.okhttp" % "okhttp" % "2.7.5", "com.squareup.okhttp" % "logging-interceptor" % "2.7.5", "com.google.code.gson" % "gson" % "2.8.1", + + "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.10" % "test" ) diff --git a/samples/client/petstore/java/okhttp-gson/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/okhttp-gson/docs/AdditionalPropertiesClass.md index 0437c4dd8cc..b37862da7cf 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/AdditionalPropertiesClass.md +++ b/samples/client/petstore/java/okhttp-gson/docs/AdditionalPropertiesClass.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson/docs/Animal.md b/samples/client/petstore/java/okhttp-gson/docs/Animal.md index b3f325c3524..346caaf63f4 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Animal.md +++ b/samples/client/petstore/java/okhttp-gson/docs/Animal.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson/docs/AnimalFarm.md b/samples/client/petstore/java/okhttp-gson/docs/AnimalFarm.md deleted file mode 100644 index c7c7f1ddcce..00000000000 --- a/samples/client/petstore/java/okhttp-gson/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ - -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - diff --git a/samples/client/petstore/java/okhttp-gson/docs/AnotherFakeApi.md b/samples/client/petstore/java/okhttp-gson/docs/AnotherFakeApi.md index 7a04619aaba..fb5c988e6cc 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/docs/ApiResponse.md b/samples/client/petstore/java/okhttp-gson/docs/ApiResponse.md deleted file mode 100644 index 1c17767c2b7..00000000000 --- a/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/okhttp-gson/docs/ArrayOfArrayOfNumberOnly.md index 77292549927..3671a5e9190 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/ArrayOfArrayOfNumberOnly.md +++ b/samples/client/petstore/java/okhttp-gson/docs/ArrayOfArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/okhttp-gson/docs/ArrayOfNumberOnly.md index e8cc4cd36dc..30b9b6648f4 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/ArrayOfNumberOnly.md +++ b/samples/client/petstore/java/okhttp-gson/docs/ArrayOfNumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson/docs/ArrayTest.md b/samples/client/petstore/java/okhttp-gson/docs/ArrayTest.md index 9feee16427f..4ab76343030 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/ArrayTest.md +++ b/samples/client/petstore/java/okhttp-gson/docs/ArrayTest.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson/docs/Capitalization.md b/samples/client/petstore/java/okhttp-gson/docs/Capitalization.md index 0f3064c1996..9af7864f97e 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Capitalization.md +++ b/samples/client/petstore/java/okhttp-gson/docs/Capitalization.md @@ -13,3 +13,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson/docs/Cat.md b/samples/client/petstore/java/okhttp-gson/docs/Cat.md index 6e9f71ce7dd..5e408344021 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Cat.md +++ b/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/docs/Category.md b/samples/client/petstore/java/okhttp-gson/docs/Category.md index e2df0803278..deb5a3e2a52 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Category.md +++ b/samples/client/petstore/java/okhttp-gson/docs/Category.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson/docs/ClassModel.md b/samples/client/petstore/java/okhttp-gson/docs/ClassModel.md index 64f880c8786..49c281cc0ed 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/ClassModel.md +++ b/samples/client/petstore/java/okhttp-gson/docs/ClassModel.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson/docs/Client.md b/samples/client/petstore/java/okhttp-gson/docs/Client.md index 5c490ea166c..52b2f72c79c 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Client.md +++ b/samples/client/petstore/java/okhttp-gson/docs/Client.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson/docs/Dog.md b/samples/client/petstore/java/okhttp-gson/docs/Dog.md index ac7cea323ff..00e6446e9f5 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Dog.md +++ b/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/docs/EnumArrays.md b/samples/client/petstore/java/okhttp-gson/docs/EnumArrays.md index 4dddc0bfd27..939a0e69587 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/EnumArrays.md +++ b/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/docs/EnumTest.md b/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md index 08fee344882..9722c621962 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/EnumTest.md +++ b/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md index 737ccc28293..6690b870e4e 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/okhttp-gson/docs/FakeClassnameTags123Api.md index bc728bfce5b..2bcbbb7908f 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/docs/Fake_classname_tags123Api.md b/samples/client/petstore/java/okhttp-gson/docs/Fake_classname_tags123Api.md deleted file mode 100644 index 56f7c9ea1ff..00000000000 --- a/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/docs/FakeclassnametagsApi.md b/samples/client/petstore/java/okhttp-gson/docs/FakeclassnametagsApi.md deleted file mode 100644 index f8ec0768e1f..00000000000 --- a/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/docs/FormatTest.md b/samples/client/petstore/java/okhttp-gson/docs/FormatTest.md index c7a3acb3cb7..bc11b93cb26 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/FormatTest.md +++ b/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/okhttp-gson/docs/HasOnlyReadOnly.md index c1d0aac5672..5564ddcf28a 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/HasOnlyReadOnly.md +++ b/samples/client/petstore/java/okhttp-gson/docs/HasOnlyReadOnly.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson/docs/InlineResponse200.md b/samples/client/petstore/java/okhttp-gson/docs/InlineResponse200.md deleted file mode 100644 index 487ebe429e4..00000000000 --- a/samples/client/petstore/java/okhttp-gson/docs/InlineResponse200.md +++ /dev/null @@ -1,24 +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** | [**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/okhttp-gson/docs/MapTest.md b/samples/client/petstore/java/okhttp-gson/docs/MapTest.md index 714a97a40d9..74a6fe8ae70 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/MapTest.md +++ b/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/okhttp-gson/docs/MixedPropertiesAndAdditionalPropertiesClass.md index b12e2cd70e6..4507481b5a9 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ b/samples/client/petstore/java/okhttp-gson/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson/docs/Model200Response.md b/samples/client/petstore/java/okhttp-gson/docs/Model200Response.md index 5b3a9a0e46d..8d2cc50bb83 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Model200Response.md +++ b/samples/client/petstore/java/okhttp-gson/docs/Model200Response.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson/docs/ModelApiResponse.md b/samples/client/petstore/java/okhttp-gson/docs/ModelApiResponse.md index 3eec8686cc9..06052b202f1 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/ModelApiResponse.md +++ b/samples/client/petstore/java/okhttp-gson/docs/ModelApiResponse.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson/docs/ModelReturn.md b/samples/client/petstore/java/okhttp-gson/docs/ModelReturn.md index a679b04953e..a7845ba254b 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/ModelReturn.md +++ b/samples/client/petstore/java/okhttp-gson/docs/ModelReturn.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson/docs/Name.md b/samples/client/petstore/java/okhttp-gson/docs/Name.md index ce2fb4dee50..a8d6fec9714 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Name.md +++ b/samples/client/petstore/java/okhttp-gson/docs/Name.md @@ -11,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson/docs/NumberOnly.md b/samples/client/petstore/java/okhttp-gson/docs/NumberOnly.md index a3feac7fadc..adfb36a95bb 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/NumberOnly.md +++ b/samples/client/petstore/java/okhttp-gson/docs/NumberOnly.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson/docs/Order.md b/samples/client/petstore/java/okhttp-gson/docs/Order.md index 268c617d1ff..7e4beff6df1 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Order.md +++ b/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/docs/OuterBoolean.md b/samples/client/petstore/java/okhttp-gson/docs/OuterBoolean.md deleted file mode 100644 index 0c792032f84..00000000000 --- a/samples/client/petstore/java/okhttp-gson/docs/OuterBoolean.md +++ /dev/null @@ -1,9 +0,0 @@ - -# OuterBoolean - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - diff --git a/samples/client/petstore/java/okhttp-gson/docs/OuterComposite.md b/samples/client/petstore/java/okhttp-gson/docs/OuterComposite.md index 3f5a633c998..1963c7a0f73 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/OuterComposite.md +++ b/samples/client/petstore/java/okhttp-gson/docs/OuterComposite.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson/docs/OuterNumber.md b/samples/client/petstore/java/okhttp-gson/docs/OuterNumber.md deleted file mode 100644 index ab7613b1810..00000000000 --- a/samples/client/petstore/java/okhttp-gson/docs/OuterNumber.md +++ /dev/null @@ -1,9 +0,0 @@ - -# OuterNumber - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - diff --git a/samples/client/petstore/java/okhttp-gson/docs/OuterString.md b/samples/client/petstore/java/okhttp-gson/docs/OuterString.md deleted file mode 100644 index 3079fce4a0d..00000000000 --- a/samples/client/petstore/java/okhttp-gson/docs/OuterString.md +++ /dev/null @@ -1,9 +0,0 @@ - -# OuterString - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - diff --git a/samples/client/petstore/java/okhttp-gson/docs/Pet.md b/samples/client/petstore/java/okhttp-gson/docs/Pet.md index 5b63109ef92..1492195a58d 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Pet.md +++ b/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/docs/PetApi.md b/samples/client/petstore/java/okhttp-gson/docs/PetApi.md index b5fa395947d..4758743434a 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/PetApi.md +++ b/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/docs/ReadOnlyFirst.md b/samples/client/petstore/java/okhttp-gson/docs/ReadOnlyFirst.md index 426b7cde95a..57655e5b49e 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/ReadOnlyFirst.md +++ b/samples/client/petstore/java/okhttp-gson/docs/ReadOnlyFirst.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson/docs/SpecialModelName.md b/samples/client/petstore/java/okhttp-gson/docs/SpecialModelName.md index c2c6117c552..f4259d2a73c 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/SpecialModelName.md +++ b/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/docs/StoreApi.md b/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md index 7aed6450e6a..a4678ee745c 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/StoreApi.md +++ b/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/docs/Tag.md b/samples/client/petstore/java/okhttp-gson/docs/Tag.md index de6814b55d5..7a97d4c6812 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/Tag.md +++ b/samples/client/petstore/java/okhttp-gson/docs/Tag.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson/docs/User.md b/samples/client/petstore/java/okhttp-gson/docs/User.md index 8b6753dd284..cf7f9ce1312 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/User.md +++ b/samples/client/petstore/java/okhttp-gson/docs/User.md @@ -15,3 +15,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/java/okhttp-gson/docs/UserApi.md b/samples/client/petstore/java/okhttp-gson/docs/UserApi.md index 2e6987951c8..e421376ce79 100644 --- a/samples/client/petstore/java/okhttp-gson/docs/UserApi.md +++ b/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/git_push.sh b/samples/client/petstore/java/okhttp-gson/git_push.sh index ae01b182ae9..ed374619b13 100644 --- a/samples/client/petstore/java/okhttp-gson/git_push.sh +++ b/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/okhttp-gson/gradle/wrapper/gradle-wrapper.jar index 2c6137b8789..e69de29bb2d 100644 Binary files a/samples/client/petstore/java/okhttp-gson/gradle/wrapper/gradle-wrapper.jar and b/samples/client/petstore/java/okhttp-gson/gradle/wrapper/gradle-wrapper.jar differ diff --git a/samples/client/petstore/java/okhttp-gson/pom.xml b/samples/client/petstore/java/okhttp-gson/pom.xml index b9e81522265..a9d52ec32b6 100644 --- a/samples/client/petstore/java/okhttp-gson/pom.xml +++ b/samples/client/petstore/java/okhttp-gson/pom.xml @@ -1,242 +1,228 @@ - 4.0.0 - io.swagger - swagger-petstore-okhttp-gson - jar - swagger-petstore-okhttp-gson - 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-okhttp-gson + jar + swagger-petstore-okhttp-gson + 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-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-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.okhttp - okhttp - ${okhttp-version} - - - com.squareup.okhttp - logging-interceptor - ${okhttp-version} - - - com.google.code.gson - gson - ${gson-version} - - - io.gsonfire - gson-fire - ${gson-fire-version} - - - org.threeten - threetenbp - ${threetenbp-version} - - - - junit - junit - ${junit-version} - test - - - - 1.7 - ${java.version} - ${java.version} - 1.8.0 - 1.5.15 - 2.7.5 - 2.8.1 - 1.3.5 - 1.0.0 - 4.12 - UTF-8 - + + + io.swagger + swagger-annotations + ${swagger-core-version} + + + com.squareup.okhttp + okhttp + ${okhttp-version} + + + com.squareup.okhttp + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + + + org.threeten + threetenbp + ${threetenbp-version} + + + + + + + + + junit + junit + ${junit-version} + test + + + + 1.7 + ${java.version} + ${java.version} + 1.5.15 + 2.7.5 + 2.8.1 + + + + 1.3.5 + + 1.0.0 + 4.12 + UTF-8 + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java index a82ca551679..16995930624 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java @@ -19,10 +19,13 @@ import com.squareup.okhttp.logging.HttpLoggingInterceptor.Level; import okio.BufferedSink; import okio.Okio; + + import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import org.threeten.bp.format.DateTimeFormatter; + import javax.net.ssl.*; import java.io.File; import java.io.IOException; @@ -39,6 +42,7 @@ import java.security.cert.CertificateFactory; import java.security.cert.X509Certificate; import java.text.DateFormat; + import java.util.*; import java.util.Map.Entry; import java.util.concurrent.TimeUnit; @@ -79,6 +83,7 @@ public class ApiClient { public ApiClient() { httpClient = new OkHttpClient(); + verifyingSsl = true; @@ -233,6 +238,8 @@ public ApiClient setSqlDateFormat(DateFormat dateFormat) { return this; } + + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { this.json.setOffsetDateTimeFormat(dateFormat); return this; @@ -243,6 +250,7 @@ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { return this; } + public ApiClient setLenientOnJson(boolean lenientOnJson) { this.json.setLenientOnJson(lenientOnJson); return this; @@ -408,7 +416,7 @@ public String getTempFolderPath() { } /** - * Set the temporary folder path (for downloading files) + * Set the tempoaray folder path (for downloading files) * * @param tempFolderPath Temporary folder path * @return ApiClient @@ -430,7 +438,6 @@ public int getConnectTimeout() { /** * Sets the connect timeout (in milliseconds). * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link Integer#MAX_VALUE}. * * @param connectionTimeout connection timeout in milliseconds * @return Api client @@ -440,50 +447,6 @@ public ApiClient setConnectTimeout(int connectionTimeout) { return this; } - /** - * Get read timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getReadTimeout() { - return httpClient.getReadTimeout(); - } - - /** - * Sets 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) { - httpClient.setReadTimeout(readTimeout, TimeUnit.MILLISECONDS); - return this; - } - - /** - * Get write timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public int getWriteTimeout() { - return httpClient.getWriteTimeout(); - } - - /** - * Sets the write timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link Integer#MAX_VALUE}. - * - * @param writeTimeout connection timeout in milliseconds - * @return Api client - */ - public ApiClient setWriteTimeout(int writeTimeout) { - httpClient.setWriteTimeout(writeTimeout, TimeUnit.MILLISECONDS); - return this; - } - /** * Format the given parameter object into string. * diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/JSON.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/JSON.java index df84d970239..f0b104f8b32 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/JSON.java @@ -20,14 +20,12 @@ import com.google.gson.internal.bind.util.ISO8601Utils; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; -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; import java.io.StringReader; @@ -35,58 +33,29 @@ import java.text.DateFormat; import java.text.ParseException; import java.text.ParsePosition; + import java.util.Date; -import java.util.Map; -import java.util.HashMap; public class JSON { private Gson gson; private boolean isLenientOnJson = false; 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")); - } - }) - ; - return fireBuilder.createGsonBuilder(); - } - - private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { - JsonElement element = readElement.getAsJsonObject().get(discriminatorField); - if(null == element) { - throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); - } - return element.getAsString(); - } - - private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { - Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue.toUpperCase()); - if(null == clazz) { - throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); - } - return clazz; - } + public JSON() { - gson = createGson() + gson = new GsonBuilder() .registerTypeAdapter(Date.class, dateTypeAdapter) .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) + + .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) + .create(); } @@ -153,6 +122,8 @@ public T deserialize(String body, Type returnType) { } } + + /** * Gson TypeAdapter for JSR310 OffsetDateTime type */ @@ -248,6 +219,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/okhttp-gson/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/AnotherFakeApi.java index e8abc4b61d6..19a39ad477e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -22,19 +22,26 @@ import io.swagger.client.ProgressRequestBody; import io.swagger.client.ProgressResponseBody; + import com.google.gson.reflect.TypeToken; import java.io.IOException; + + import io.swagger.client.model.Client; + import java.lang.reflect.Type; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class AnotherFakeApi { private ApiClient apiClient; @@ -54,17 +61,19 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * Build call for testSpecialTags - * @param body client model (required) + * @param client client model (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call testSpecialTagsCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - + public com.squareup.okhttp.Call testSpecialTagsCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = client; + // create path and map variables String localVarPath = "/another-fake/dummy"; @@ -102,42 +111,51 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testSpecialTagsValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testSpecialTagsValidateBeforeCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling testSpecialTags(Async)"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException("Missing the required parameter 'client' when calling testSpecialTags(Async)"); } - - com.squareup.okhttp.Call call = testSpecialTagsCall(body, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = testSpecialTagsCall(client, progressListener, progressRequestListener); return call; + + + + + + } /** * To test special tags * To test special tags - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public Client testSpecialTags(Client body) throws ApiException { - ApiResponse resp = testSpecialTagsWithHttpInfo(body); + public Client testSpecialTags(Client client) throws ApiException { + ApiResponse resp = testSpecialTagsWithHttpInfo(client); return resp.getData(); } /** * To test special tags * To test special tags - * @param body client model (required) + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse testSpecialTagsWithHttpInfo(Client body) throws ApiException { - com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(body, null, null); + public ApiResponse testSpecialTagsWithHttpInfo(Client client) throws ApiException { + com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(client, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -145,12 +163,13 @@ public ApiResponse testSpecialTagsWithHttpInfo(Client body) throws ApiEx /** * To test special tags (asynchronously) * To test special tags - * @param body client model (required) + * @param client client model (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call testSpecialTagsAsync(Client body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testSpecialTagsAsync(Client client, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -171,9 +190,10 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testSpecialTagsValidateBeforeCall(client, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java index beb9cb1f8ff..1b84a7af7c1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeApi.java @@ -22,23 +22,28 @@ import io.swagger.client.ProgressRequestBody; import io.swagger.client.ProgressResponseBody; + import com.google.gson.reflect.TypeToken; import java.io.IOException; + + 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.lang.reflect.Type; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class FakeApi { private ApiClient apiClient; @@ -58,6 +63,7 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * Build call for fakeOuterBooleanSerialize * @param body Input boolean as post body (optional) @@ -65,10 +71,11 @@ public void setApiClient(ApiClient apiClient) { * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call fakeOuterBooleanSerializeCall(Boolean body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; - + // create path and map variables String localVarPath = "/fake/outer/boolean"; @@ -80,13 +87,13 @@ public com.squareup.okhttp.Call fakeOuterBooleanSerializeCall(Boolean body, fina Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -106,14 +113,21 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call fakeOuterBooleanSerializeValidateBeforeCall(Boolean body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - + + com.squareup.okhttp.Call call = fakeOuterBooleanSerializeCall(body, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -122,6 +136,7 @@ private com.squareup.okhttp.Call fakeOuterBooleanSerializeValidateBeforeCall(Boo * @param body Input boolean as post body (optional) * @return Boolean * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { ApiResponse resp = fakeOuterBooleanSerializeWithHttpInfo(body); @@ -134,6 +149,7 @@ public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { * @param body Input boolean as post body (optional) * @return ApiResponse<Boolean> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { com.squareup.okhttp.Call call = fakeOuterBooleanSerializeValidateBeforeCall(body, null, null); @@ -148,6 +164,7 @@ public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call fakeOuterBooleanSerializeAsync(Boolean body, final ApiCallback callback) throws ApiException { @@ -175,17 +192,19 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for fakeOuterCompositeSerialize - * @param body Input composite as post body (optional) + * @param outercomposite Input composite as post body (optional) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call fakeOuterCompositeSerializeCall(OuterComposite body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - + public com.squareup.okhttp.Call fakeOuterCompositeSerializeCall(OuterComposite outercomposite, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = outercomposite; + // create path and map variables String localVarPath = "/fake/outer/composite"; @@ -197,13 +216,13 @@ public com.squareup.okhttp.Call fakeOuterCompositeSerializeCall(OuterComposite b Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -223,37 +242,46 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call fakeOuterCompositeSerializeValidateBeforeCall(OuterComposite body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call fakeOuterCompositeSerializeValidateBeforeCall(OuterComposite outercomposite, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = fakeOuterCompositeSerializeCall(body, progressListener, progressRequestListener); + + + com.squareup.okhttp.Call call = fakeOuterCompositeSerializeCall(outercomposite, progressListener, progressRequestListener); return call; + + + + + + } /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outercomposite Input composite as post body (optional) * @return OuterComposite * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws ApiException { - ApiResponse resp = fakeOuterCompositeSerializeWithHttpInfo(body); + public OuterComposite fakeOuterCompositeSerialize(OuterComposite outercomposite) throws ApiException { + ApiResponse resp = fakeOuterCompositeSerializeWithHttpInfo(outercomposite); return resp.getData(); } /** * * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outercomposite Input composite as post body (optional) * @return ApiResponse<OuterComposite> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws ApiException { - com.squareup.okhttp.Call call = fakeOuterCompositeSerializeValidateBeforeCall(body, null, null); + public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite outercomposite) throws ApiException { + com.squareup.okhttp.Call call = fakeOuterCompositeSerializeValidateBeforeCall(outercomposite, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -261,12 +289,13 @@ public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(Outer /** * (asynchronously) * Test serialization of object with outer number type - * @param body Input composite as post body (optional) + * @param outercomposite Input composite as post body (optional) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call fakeOuterCompositeSerializeAsync(OuterComposite body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call fakeOuterCompositeSerializeAsync(OuterComposite outercomposite, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -287,11 +316,12 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = fakeOuterCompositeSerializeValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = fakeOuterCompositeSerializeValidateBeforeCall(outercomposite, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for fakeOuterNumberSerialize * @param body Input number as post body (optional) @@ -299,10 +329,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call fakeOuterNumberSerializeCall(BigDecimal body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; - + // create path and map variables String localVarPath = "/fake/outer/number"; @@ -314,13 +345,13 @@ public com.squareup.okhttp.Call fakeOuterNumberSerializeCall(BigDecimal body, fi Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -340,14 +371,21 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call fakeOuterNumberSerializeValidateBeforeCall(BigDecimal body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - + + com.squareup.okhttp.Call call = fakeOuterNumberSerializeCall(body, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -356,6 +394,7 @@ private com.squareup.okhttp.Call fakeOuterNumberSerializeValidateBeforeCall(BigD * @param body Input number as post body (optional) * @return BigDecimal * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException { ApiResponse resp = fakeOuterNumberSerializeWithHttpInfo(body); @@ -368,6 +407,7 @@ public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException * @param body Input number as post body (optional) * @return ApiResponse<BigDecimal> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException { com.squareup.okhttp.Call call = fakeOuterNumberSerializeValidateBeforeCall(body, null, null); @@ -382,6 +422,7 @@ public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal b * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call fakeOuterNumberSerializeAsync(BigDecimal body, final ApiCallback callback) throws ApiException { @@ -409,6 +450,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for fakeOuterStringSerialize * @param body Input string as post body (optional) @@ -416,10 +458,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call fakeOuterStringSerializeCall(String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; - + // create path and map variables String localVarPath = "/fake/outer/string"; @@ -431,13 +474,13 @@ public com.squareup.okhttp.Call fakeOuterStringSerializeCall(String body, final Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - + "*/*" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -457,14 +500,21 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call fakeOuterStringSerializeValidateBeforeCall(String body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - + + com.squareup.okhttp.Call call = fakeOuterStringSerializeCall(body, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -473,6 +523,7 @@ private com.squareup.okhttp.Call fakeOuterStringSerializeValidateBeforeCall(Stri * @param body Input string as post body (optional) * @return String * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public String fakeOuterStringSerialize(String body) throws ApiException { ApiResponse resp = fakeOuterStringSerializeWithHttpInfo(body); @@ -485,6 +536,7 @@ public String fakeOuterStringSerialize(String body) throws ApiException { * @param body Input string as post body (optional) * @return ApiResponse<String> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) throws ApiException { com.squareup.okhttp.Call call = fakeOuterStringSerializeValidateBeforeCall(body, null, null); @@ -499,6 +551,7 @@ public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) thr * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call fakeOuterStringSerializeAsync(String body, final ApiCallback callback) throws ApiException { @@ -526,17 +579,19 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for testClientModel - * @param body client model (required) + * @param client client model (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call testClientModelCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - + public com.squareup.okhttp.Call testClientModelCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = client; + // create path and map variables String localVarPath = "/fake"; @@ -574,42 +629,51 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testClientModelValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testClientModelValidateBeforeCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling testClientModel(Async)"); + + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException("Missing the required parameter 'client' when calling testClientModel(Async)"); } - - com.squareup.okhttp.Call call = testClientModelCall(body, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = testClientModelCall(client, progressListener, progressRequestListener); return call; + + + + + + } /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public Client testClientModel(Client body) throws ApiException { - ApiResponse resp = testClientModelWithHttpInfo(body); + public Client testClientModel(Client client) throws ApiException { + ApiResponse resp = testClientModelWithHttpInfo(client); return resp.getData(); } /** * To test \"client\" model * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse testClientModelWithHttpInfo(Client body) throws ApiException { - com.squareup.okhttp.Call call = testClientModelValidateBeforeCall(body, null, null); + public ApiResponse testClientModelWithHttpInfo(Client client) throws ApiException { + com.squareup.okhttp.Call call = testClientModelValidateBeforeCall(client, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -617,12 +681,13 @@ public ApiResponse testClientModelWithHttpInfo(Client body) throws ApiEx /** * To test \"client\" model (asynchronously) * To test \"client\" model - * @param body client model (required) + * @param client client model (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call testClientModelAsync(Client body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testClientModelAsync(Client client, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -643,35 +708,24 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = testClientModelValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testClientModelValidateBeforeCall(client, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for testEndpointParameters - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) + * @param body (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call testEndpointParametersCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - + public com.squareup.okhttp.Call testEndpointParametersCall(Object body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + // create path and map variables String localVarPath = "/fake"; @@ -681,37 +735,9 @@ public com.squareup.okhttp.Call testEndpointParametersCall(BigDecimal number, Do 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); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -737,106 +763,62 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "http_basic_test" }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testEndpointParametersValidateBeforeCall(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - // verify the required parameter 'number' is set - if (number == null) { - throw new ApiException("Missing the required parameter 'number' when calling testEndpointParameters(Async)"); - } + private com.squareup.okhttp.Call testEndpointParametersValidateBeforeCall(Object body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter '_double' is set - if (_double == null) { - throw new ApiException("Missing the required parameter '_double' when calling testEndpointParameters(Async)"); - } - // verify the required parameter 'patternWithoutDelimiter' is set - if (patternWithoutDelimiter == null) { - throw new ApiException("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters(Async)"); + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling testEndpointParameters(Async)"); } - // verify the required parameter '_byte' is set - if (_byte == null) { - throw new ApiException("Missing the required parameter '_byte' when calling testEndpointParameters(Async)"); - } - - com.squareup.okhttp.Call call = testEndpointParametersCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testEndpointParametersCall(body, progressListener, progressRequestListener); return call; + + + + + + } /** * 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 fail to call the API, e.g. server error or cannot deserialize the response body + */ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { - testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); + public void testEndpointParameters(Object body) throws ApiException { + testEndpointParametersWithHttpInfo(body); } /** * 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 ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { - com.squareup.okhttp.Call call = testEndpointParametersValidateBeforeCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, null, null); + public ApiResponse testEndpointParametersWithHttpInfo(Object body) throws ApiException { + com.squareup.okhttp.Call call = testEndpointParametersValidateBeforeCall(body, null, null); return apiClient.execute(call); } /** * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 (asynchronously) * 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 callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call testEndpointParametersAsync(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testEndpointParametersAsync(Object body, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -857,35 +839,35 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = testEndpointParametersValidateBeforeCall(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testEndpointParametersValidateBeforeCall(body, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } + /** * Build call for testEnumParameters - * @param enumFormStringArray Form parameter enum test (string array) (optional) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @param 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 progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call testEnumParametersCall(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - + public com.squareup.okhttp.Call testEnumParametersCall(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + // create path and map variables String localVarPath = "/fake"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); if (enumQueryStringArray != null) - localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray)); + localVarQueryParams.addAll(apiClient.parameterToPair("enum_query_string_array", enumQueryStringArray)); if (enumQueryString != null) localVarQueryParams.addAll(apiClient.parameterToPair("enum_query_string", enumQueryString)); if (enumQueryInteger != null) @@ -898,15 +880,9 @@ public com.squareup.okhttp.Call testEnumParametersCall(List enumFormStri localVarHeaderParams.put("enum_header_string", apiClient.parameterToString(enumHeaderString)); 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); final String[] localVarAccepts = { - "*/*" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -932,68 +908,72 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testEnumParametersValidateBeforeCall(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testEnumParametersValidateBeforeCall(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - - com.squareup.okhttp.Call call = testEnumParametersCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, progressListener, progressRequestListener); + + + com.squareup.okhttp.Call call = testEnumParametersCall(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, progressListener, progressRequestListener); return call; + + + + + + } /** * 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 fail to call the API, e.g. server error or cannot deserialize the response body + */ - public void testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws ApiException { - testEnumParametersWithHttpInfo(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); + public void testEnumParameters(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger) throws ApiException { + testEnumParametersWithHttpInfo(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger); } /** * 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 ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse testEnumParametersWithHttpInfo(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws ApiException { - com.squareup.okhttp.Call call = testEnumParametersValidateBeforeCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, null, null); + public ApiResponse testEnumParametersWithHttpInfo(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger) throws ApiException { + com.squareup.okhttp.Call call = testEnumParametersValidateBeforeCall(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, null, null); return apiClient.execute(call); } /** * To test enum parameters (asynchronously) * To test enum parameters - * @param enumFormStringArray Form parameter enum test (string array) (optional) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @param 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 callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call testEnumParametersAsync(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testEnumParametersAsync(Object body, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1014,21 +994,23 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = testEnumParametersValidateBeforeCall(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testEnumParametersValidateBeforeCall(body, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } + /** * Build call for testInlineAdditionalProperties - * @param param request body (required) + * @param body request body (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call testInlineAdditionalPropertiesCall(Object param, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = param; - + public com.squareup.okhttp.Call testInlineAdditionalPropertiesCall(Map body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + // create path and map variables String localVarPath = "/fake/inline-additionalProperties"; @@ -1066,52 +1048,62 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testInlineAdditionalPropertiesValidateBeforeCall(Object param, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testInlineAdditionalPropertiesValidateBeforeCall(Map body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + - // verify the required parameter 'param' is set - if (param == null) { - throw new ApiException("Missing the required parameter 'param' when calling testInlineAdditionalProperties(Async)"); + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling testInlineAdditionalProperties(Async)"); } - - com.squareup.okhttp.Call call = testInlineAdditionalPropertiesCall(param, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = testInlineAdditionalPropertiesCall(body, progressListener, progressRequestListener); return call; + + + + + + } /** * test inline additionalProperties * - * @param param request body (required) + * @param body request body (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public void testInlineAdditionalProperties(Object param) throws ApiException { - testInlineAdditionalPropertiesWithHttpInfo(param); + public void testInlineAdditionalProperties(Map body) throws ApiException { + testInlineAdditionalPropertiesWithHttpInfo(body); } /** * test inline additionalProperties * - * @param param request body (required) + * @param body request body (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Object param) throws ApiException { - com.squareup.okhttp.Call call = testInlineAdditionalPropertiesValidateBeforeCall(param, null, null); + public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Map body) throws ApiException { + com.squareup.okhttp.Call call = testInlineAdditionalPropertiesValidateBeforeCall(body, null, null); return apiClient.execute(call); } /** * test inline additionalProperties (asynchronously) * - * @param param request body (required) + * @param body request body (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call testInlineAdditionalPropertiesAsync(Object param, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testInlineAdditionalPropertiesAsync(Map body, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1132,22 +1124,23 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = testInlineAdditionalPropertiesValidateBeforeCall(param, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testInlineAdditionalPropertiesValidateBeforeCall(body, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } + /** * Build call for testJsonFormData - * @param param field1 (required) - * @param param2 field2 (required) + * @param body (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call testJsonFormDataCall(String param, String param2, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - + public com.squareup.okhttp.Call testJsonFormDataCall(Object body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + // create path and map variables String localVarPath = "/fake/jsonFormData"; @@ -1157,10 +1150,6 @@ public com.squareup.okhttp.Call testJsonFormDataCall(String param, String param2 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 = { @@ -1189,60 +1178,62 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testJsonFormDataValidateBeforeCall(String param, String param2, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testJsonFormDataValidateBeforeCall(Object body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'param' is set - if (param == null) { - throw new ApiException("Missing the required parameter 'param' when calling testJsonFormData(Async)"); - } - // verify the required parameter 'param2' is set - if (param2 == null) { - throw new ApiException("Missing the required parameter 'param2' when calling testJsonFormData(Async)"); + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling testJsonFormData(Async)"); } - - com.squareup.okhttp.Call call = testJsonFormDataCall(param, param2, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = testJsonFormDataCall(body, progressListener, progressRequestListener); return call; + + + + + + } /** * test json serialization of form data * - * @param param field1 (required) - * @param param2 field2 (required) + * @param body (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public void testJsonFormData(String param, String param2) throws ApiException { - testJsonFormDataWithHttpInfo(param, param2); + public void testJsonFormData(Object body) throws ApiException { + testJsonFormDataWithHttpInfo(body); } /** * test json serialization of form data * - * @param param field1 (required) - * @param param2 field2 (required) + * @param body (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException { - com.squareup.okhttp.Call call = testJsonFormDataValidateBeforeCall(param, param2, null, null); + public ApiResponse testJsonFormDataWithHttpInfo(Object body) throws ApiException { + com.squareup.okhttp.Call call = testJsonFormDataValidateBeforeCall(body, null, null); return apiClient.execute(call); } /** * test json serialization of form data (asynchronously) * - * @param param field1 (required) - * @param param2 field2 (required) + * @param body (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call testJsonFormDataAsync(String param, String param2, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testJsonFormDataAsync(Object body, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1263,8 +1254,9 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = testJsonFormDataValidateBeforeCall(param, param2, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testJsonFormDataValidateBeforeCall(body, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index cd516030e2c..0fe5985902b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -22,19 +22,26 @@ import io.swagger.client.ProgressRequestBody; import io.swagger.client.ProgressResponseBody; + import com.google.gson.reflect.TypeToken; import java.io.IOException; + + import io.swagger.client.model.Client; + import java.lang.reflect.Type; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class FakeClassnameTags123Api { private ApiClient apiClient; @@ -54,17 +61,19 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * Build call for testClassname - * @param body client model (required) + * @param client client model (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call testClassnameCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - + public com.squareup.okhttp.Call testClassnameCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = client; + // create path and map variables String localVarPath = "/fake_classname_test"; @@ -102,42 +111,51 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "api_key_query" }; return apiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call testClassnameValidateBeforeCall(Client body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call testClassnameValidateBeforeCall(Client client, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling testClassname(Async)"); + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException("Missing the required parameter 'client' when calling testClassname(Async)"); } - - com.squareup.okhttp.Call call = testClassnameCall(body, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = testClassnameCall(client, progressListener, progressRequestListener); return call; + + + + + + } /** * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return Client * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public Client testClassname(Client body) throws ApiException { - ApiResponse resp = testClassnameWithHttpInfo(body); + public Client testClassname(Client client) throws ApiException { + ApiResponse resp = testClassnameWithHttpInfo(client); return resp.getData(); } /** * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return ApiResponse<Client> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse testClassnameWithHttpInfo(Client body) throws ApiException { - com.squareup.okhttp.Call call = testClassnameValidateBeforeCall(body, null, null); + public ApiResponse testClassnameWithHttpInfo(Client client) throws ApiException { + com.squareup.okhttp.Call call = testClassnameValidateBeforeCall(client, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -145,12 +163,13 @@ public ApiResponse testClassnameWithHttpInfo(Client body) throws ApiExce /** * To test class name in snake case (asynchronously) * - * @param body client model (required) + * @param client client model (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call testClassnameAsync(Client body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call testClassnameAsync(Client client, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -171,9 +190,10 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = testClassnameValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = testClassnameValidateBeforeCall(client, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java index 23b9049e61b..1749a61495a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/PetApi.java @@ -22,21 +22,27 @@ import io.swagger.client.ProgressRequestBody; import io.swagger.client.ProgressResponseBody; + import com.google.gson.reflect.TypeToken; import java.io.IOException; -import java.io.File; + + import io.swagger.client.model.ModelApiResponse; import io.swagger.client.model.Pet; + import java.lang.reflect.Type; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class PetApi { private ApiClient apiClient; @@ -56,17 +62,19 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * Build call for addPet - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call addPetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - + public com.squareup.okhttp.Call addPetCall(Pet pet, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = pet; + // create path and map variables String localVarPath = "/pet"; @@ -78,7 +86,7 @@ public com.squareup.okhttp.Call addPetCall(Pet body, final ProgressResponseBody. Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -104,52 +112,62 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "petstore_auth" }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call addPetValidateBeforeCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call addPetValidateBeforeCall(Pet pet, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling addPet(Async)"); + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException("Missing the required parameter 'pet' when calling addPet(Async)"); } - - com.squareup.okhttp.Call call = addPetCall(body, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = addPetCall(pet, progressListener, progressRequestListener); return call; + + + + + + } /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public void addPet(Pet body) throws ApiException { - addPetWithHttpInfo(body); + public void addPet(Pet pet) throws ApiException { + addPetWithHttpInfo(pet); } /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse addPetWithHttpInfo(Pet body) throws ApiException { - com.squareup.okhttp.Call call = addPetValidateBeforeCall(body, null, null); + public ApiResponse addPetWithHttpInfo(Pet pet) throws ApiException { + com.squareup.okhttp.Call call = addPetValidateBeforeCall(pet, null, null); return apiClient.execute(call); } /** * Add a new pet to the store (asynchronously) * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call addPetAsync(Pet body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call addPetAsync(Pet pet, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -170,10 +188,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = addPetValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = addPetValidateBeforeCall(pet, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } + /** * Build call for deletePet * @param petId Pet id to delete (required) @@ -182,10 +201,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call deletePetCall(Long petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + public com.squareup.okhttp.Call deletePetCall(Integer petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); @@ -200,7 +220,7 @@ public com.squareup.okhttp.Call deletePetCall(Long petId, String apiKey, final P Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -226,19 +246,26 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "petstore_auth" }; return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call deletePetValidateBeforeCall(Long petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call deletePetValidateBeforeCall(Integer petId, String apiKey, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling deletePet(Async)"); } - + com.squareup.okhttp.Call call = deletePetCall(petId, apiKey, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -247,8 +274,9 @@ private com.squareup.okhttp.Call deletePetValidateBeforeCall(Long petId, String * @param petId Pet id to delete (required) * @param apiKey (optional) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public void deletePet(Long petId, String apiKey) throws ApiException { + public void deletePet(Integer petId, String apiKey) throws ApiException { deletePetWithHttpInfo(petId, apiKey); } @@ -259,8 +287,9 @@ public void deletePet(Long petId, String apiKey) throws ApiException { * @param apiKey (optional) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { + public ApiResponse deletePetWithHttpInfo(Integer petId, String apiKey) throws ApiException { com.squareup.okhttp.Call call = deletePetValidateBeforeCall(petId, apiKey, null, null); return apiClient.execute(call); } @@ -273,8 +302,9 @@ public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call deletePetAsync(Long petId, String apiKey, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call deletePetAsync(Integer petId, String apiKey, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -299,6 +329,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, callback); return call; } + /** * Build call for findPetsByStatus * @param status Status values that need to be considered for filter (required) @@ -306,17 +337,18 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call findPetsByStatusCall(List status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/pet/findByStatus"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); if (status != null) - localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status)); + localVarQueryParams.addAll(apiClient.parameterToPair("status", status)); Map localVarHeaderParams = new HashMap(); @@ -349,19 +381,26 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "petstore_auth" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call findPetsByStatusValidateBeforeCall(List status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'status' is set if (status == null) { throw new ApiException("Missing the required parameter 'status' when calling findPetsByStatus(Async)"); } - + com.squareup.okhttp.Call call = findPetsByStatusCall(status, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -370,6 +409,7 @@ private com.squareup.okhttp.Call findPetsByStatusValidateBeforeCall(List * @param status Status values that need to be considered for filter (required) * @return List<Pet> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public List findPetsByStatus(List status) throws ApiException { ApiResponse> resp = findPetsByStatusWithHttpInfo(status); @@ -382,6 +422,7 @@ public List findPetsByStatus(List status) throws ApiException { * @param status Status values that need to be considered for filter (required) * @return ApiResponse<List<Pet>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { com.squareup.okhttp.Call call = findPetsByStatusValidateBeforeCall(status, null, null); @@ -396,6 +437,7 @@ public ApiResponse> findPetsByStatusWithHttpInfo(List status) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call findPetsByStatusAsync(List status, final ApiCallback> callback) throws ApiException { @@ -423,6 +465,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for findPetsByTags * @param tags Tags to filter by (required) @@ -430,19 +473,18 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object - * @deprecated + */ - @Deprecated public com.squareup.okhttp.Call findPetsByTagsCall(List tags, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/pet/findByTags"; List localVarQueryParams = new ArrayList(); List localVarCollectionQueryParams = new ArrayList(); if (tags != null) - localVarCollectionQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags)); + localVarQueryParams.addAll(apiClient.parameterToPair("tags", tags)); Map localVarHeaderParams = new HashMap(); @@ -475,20 +517,26 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "petstore_auth" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - - @Deprecated + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call findPetsByTagsValidateBeforeCall(List tags, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'tags' is set if (tags == null) { throw new ApiException("Missing the required parameter 'tags' when calling findPetsByTags(Async)"); } - + com.squareup.okhttp.Call call = findPetsByTagsCall(tags, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -497,9 +545,8 @@ private com.squareup.okhttp.Call findPetsByTagsValidateBeforeCall(List t * @param tags Tags to filter by (required) * @return List<Pet> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @deprecated + */ - @Deprecated public List findPetsByTags(List tags) throws ApiException { ApiResponse> resp = findPetsByTagsWithHttpInfo(tags); return resp.getData(); @@ -511,9 +558,8 @@ public List findPetsByTags(List tags) throws ApiException { * @param tags Tags to filter by (required) * @return ApiResponse<List<Pet>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @deprecated + */ - @Deprecated public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { com.squareup.okhttp.Call call = findPetsByTagsValidateBeforeCall(tags, null, null); Type localVarReturnType = new TypeToken>(){}.getType(); @@ -527,9 +573,8 @@ public ApiResponse> findPetsByTagsWithHttpInfo(List tags) thro * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @deprecated + */ - @Deprecated public com.squareup.okhttp.Call findPetsByTagsAsync(List tags, final ApiCallback> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; @@ -556,6 +601,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for getPetById * @param petId ID of pet to return (required) @@ -563,10 +609,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call getPetByIdCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + public com.squareup.okhttp.Call getPetByIdCall(Integer petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); @@ -605,19 +652,26 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "api_key" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getPetByIdValidateBeforeCall(Long petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call getPetByIdValidateBeforeCall(Integer petId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling getPetById(Async)"); } - + com.squareup.okhttp.Call call = getPetByIdCall(petId, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -626,8 +680,9 @@ private com.squareup.okhttp.Call getPetByIdValidateBeforeCall(Long petId, final * @param petId ID of pet to return (required) * @return Pet * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public Pet getPetById(Long petId) throws ApiException { + public Pet getPetById(Integer petId) throws ApiException { ApiResponse resp = getPetByIdWithHttpInfo(petId); return resp.getData(); } @@ -638,8 +693,9 @@ public Pet getPetById(Long petId) throws ApiException { * @param petId ID of pet to return (required) * @return ApiResponse<Pet> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { + public ApiResponse getPetByIdWithHttpInfo(Integer petId) throws ApiException { com.squareup.okhttp.Call call = getPetByIdValidateBeforeCall(petId, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); @@ -652,8 +708,9 @@ public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call getPetByIdAsync(Long petId, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call getPetByIdAsync(Integer petId, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -679,17 +736,19 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for updatePet - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call updatePetCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - + public com.squareup.okhttp.Call updatePetCall(Pet pet, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = pet; + // create path and map variables String localVarPath = "/pet"; @@ -701,7 +760,7 @@ public com.squareup.okhttp.Call updatePetCall(Pet body, final ProgressResponseBo Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -727,52 +786,62 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "petstore_auth" }; return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call updatePetValidateBeforeCall(Pet body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call updatePetValidateBeforeCall(Pet pet, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling updatePet(Async)"); + + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException("Missing the required parameter 'pet' when calling updatePet(Async)"); } - - com.squareup.okhttp.Call call = updatePetCall(body, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = updatePetCall(pet, progressListener, progressRequestListener); return call; + + + + + + } /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public void updatePet(Pet body) throws ApiException { - updatePetWithHttpInfo(body); + public void updatePet(Pet pet) throws ApiException { + updatePetWithHttpInfo(pet); } /** * Update an existing pet * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse updatePetWithHttpInfo(Pet body) throws ApiException { - com.squareup.okhttp.Call call = updatePetValidateBeforeCall(body, null, null); + public ApiResponse updatePetWithHttpInfo(Pet pet) throws ApiException { + com.squareup.okhttp.Call call = updatePetValidateBeforeCall(pet, null, null); return apiClient.execute(call); } /** * Update an existing pet (asynchronously) * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call updatePetAsync(Pet body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call updatePetAsync(Pet pet, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -793,23 +862,24 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = updatePetValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = updatePetValidateBeforeCall(pet, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } + /** * Build call for updatePetWithForm * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) + * @param body (optional) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call updatePetWithFormCall(Long petId, String name, String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - + public com.squareup.okhttp.Call updatePetWithFormCall(Integer petId, Object body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + // create path and map variables String localVarPath = "/pet/{petId}" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); @@ -820,13 +890,9 @@ public com.squareup.okhttp.Call updatePetWithFormCall(Long petId, String name, S 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); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -852,44 +918,51 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "petstore_auth" }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call updatePetWithFormValidateBeforeCall(Long petId, String name, String status, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call updatePetWithFormValidateBeforeCall(Integer petId, Object body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling updatePetWithForm(Async)"); } - - com.squareup.okhttp.Call call = updatePetWithFormCall(petId, name, status, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = updatePetWithFormCall(petId, body, progressListener, progressRequestListener); return call; + + + + + + } /** * 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 fail to call the API, e.g. server error or cannot deserialize the response body + */ - public void updatePetWithForm(Long petId, String name, String status) throws ApiException { - updatePetWithFormWithHttpInfo(petId, name, status); + public void updatePetWithForm(Integer petId, Object body) throws ApiException { + updatePetWithFormWithHttpInfo(petId, body); } /** * 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 ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { - com.squareup.okhttp.Call call = updatePetWithFormValidateBeforeCall(petId, name, status, null, null); + public ApiResponse updatePetWithFormWithHttpInfo(Integer petId, Object body) throws ApiException { + com.squareup.okhttp.Call call = updatePetWithFormValidateBeforeCall(petId, body, null, null); return apiClient.execute(call); } @@ -897,13 +970,13 @@ public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, * Updates a pet in the store with form data (asynchronously) * * @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 callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call updatePetWithFormAsync(Long petId, String name, String status, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call updatePetWithFormAsync(Integer petId, Object body, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -924,23 +997,24 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = updatePetWithFormValidateBeforeCall(petId, name, status, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = updatePetWithFormValidateBeforeCall(petId, body, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } + /** * Build call for uploadFile * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) + * @param body (optional) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call uploadFileCall(Long petId, String additionalMetadata, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = null; - + public com.squareup.okhttp.Call uploadFileCall(Integer petId, Object body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + // create path and map variables String localVarPath = "/pet/{petId}/uploadImage" .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); @@ -951,10 +1025,6 @@ public com.squareup.okhttp.Call uploadFileCall(Long petId, String additionalMeta 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" @@ -983,32 +1053,39 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "petstore_auth" }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call uploadFileValidateBeforeCall(Long petId, String additionalMetadata, File file, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call uploadFileValidateBeforeCall(Integer petId, Object body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'petId' is set if (petId == null) { throw new ApiException("Missing the required parameter 'petId' when calling uploadFile(Async)"); } - - com.squareup.okhttp.Call call = uploadFileCall(petId, additionalMetadata, file, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = uploadFileCall(petId, body, progressListener, progressRequestListener); return call; + + + + + + } /** * 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 fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException { - ApiResponse resp = uploadFileWithHttpInfo(petId, additionalMetadata, file); + public ModelApiResponse uploadFile(Integer petId, Object body) throws ApiException { + ApiResponse resp = uploadFileWithHttpInfo(petId, body); return resp.getData(); } @@ -1016,13 +1093,13 @@ public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File f * 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 ApiResponse<ModelApiResponse> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException { - com.squareup.okhttp.Call call = uploadFileValidateBeforeCall(petId, additionalMetadata, file, null, null); + public ApiResponse uploadFileWithHttpInfo(Integer petId, Object body) throws ApiException { + com.squareup.okhttp.Call call = uploadFileValidateBeforeCall(petId, body, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -1031,13 +1108,13 @@ public ApiResponse uploadFileWithHttpInfo(Long petId, String a * uploads an image (asynchronously) * * @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 callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call uploadFileAsync(Long petId, String additionalMetadata, File file, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call uploadFileAsync(Integer petId, Object body, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1058,9 +1135,10 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = uploadFileValidateBeforeCall(petId, additionalMetadata, file, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = uploadFileValidateBeforeCall(petId, body, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java index a517a459d79..768543d365d 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/StoreApi.java @@ -22,19 +22,26 @@ import io.swagger.client.ProgressRequestBody; import io.swagger.client.ProgressResponseBody; + import com.google.gson.reflect.TypeToken; import java.io.IOException; + + import io.swagger.client.model.Order; + import java.lang.reflect.Type; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class StoreApi { private ApiClient apiClient; @@ -54,6 +61,7 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * Build call for deleteOrder * @param orderId ID of the order that needs to be deleted (required) @@ -61,10 +69,11 @@ public void setApiClient(ApiClient apiClient) { * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call deleteOrderCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/store/order/{order_id}" .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); @@ -77,7 +86,7 @@ public com.squareup.okhttp.Call deleteOrderCall(String orderId, final ProgressRe Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -103,19 +112,26 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call deleteOrderValidateBeforeCall(String orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'orderId' is set if (orderId == null) { throw new ApiException("Missing the required parameter 'orderId' when calling deleteOrder(Async)"); } - + com.squareup.okhttp.Call call = deleteOrderCall(orderId, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -123,6 +139,7 @@ private com.squareup.okhttp.Call deleteOrderValidateBeforeCall(String orderId, f * 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 fail to call the API, e.g. server error or cannot deserialize the response body + */ public void deleteOrder(String orderId) throws ApiException { deleteOrderWithHttpInfo(orderId); @@ -134,6 +151,7 @@ public void deleteOrder(String orderId) throws ApiException { * @param orderId ID of the order that needs to be deleted (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { com.squareup.okhttp.Call call = deleteOrderValidateBeforeCall(orderId, null, null); @@ -147,6 +165,7 @@ public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiExcep * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call deleteOrderAsync(String orderId, final ApiCallback callback) throws ApiException { @@ -173,16 +192,18 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, callback); return call; } + /** * Build call for getInventory * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call getInventoryCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/store/inventory"; @@ -220,14 +241,21 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { "api_key" }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call getInventoryValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - + + com.squareup.okhttp.Call call = getInventoryCall(progressListener, progressRequestListener); return call; + + + + + + } /** @@ -235,6 +263,7 @@ private com.squareup.okhttp.Call getInventoryValidateBeforeCall(final ProgressRe * Returns a map of status codes to quantities * @return Map<String, Integer> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public Map getInventory() throws ApiException { ApiResponse> resp = getInventoryWithHttpInfo(); @@ -246,6 +275,7 @@ public Map getInventory() throws ApiException { * Returns a map of status codes to quantities * @return ApiResponse<Map<String, Integer>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse> getInventoryWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = getInventoryValidateBeforeCall(null, null); @@ -259,6 +289,7 @@ public ApiResponse> getInventoryWithHttpInfo() throws ApiEx * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call getInventoryAsync(final ApiCallback> callback) throws ApiException { @@ -286,6 +317,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for getOrderById * @param orderId ID of pet that needs to be fetched (required) @@ -293,10 +325,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call getOrderByIdCall(Long orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + public com.squareup.okhttp.Call getOrderByIdCall(Integer orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/store/order/{order_id}" .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); @@ -335,19 +368,26 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call getOrderByIdValidateBeforeCall(Long orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call getOrderByIdValidateBeforeCall(Integer orderId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'orderId' is set if (orderId == null) { throw new ApiException("Missing the required parameter 'orderId' when calling getOrderById(Async)"); } - + com.squareup.okhttp.Call call = getOrderByIdCall(orderId, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -356,8 +396,9 @@ private com.squareup.okhttp.Call getOrderByIdValidateBeforeCall(Long orderId, fi * @param orderId ID of pet that needs to be fetched (required) * @return Order * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public Order getOrderById(Long orderId) throws ApiException { + public Order getOrderById(Integer orderId) throws ApiException { ApiResponse resp = getOrderByIdWithHttpInfo(orderId); return resp.getData(); } @@ -368,8 +409,9 @@ public Order getOrderById(Long orderId) throws ApiException { * @param orderId ID of pet that needs to be fetched (required) * @return ApiResponse<Order> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { + public ApiResponse getOrderByIdWithHttpInfo(Integer orderId) throws ApiException { com.squareup.okhttp.Call call = getOrderByIdValidateBeforeCall(orderId, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); @@ -382,8 +424,9 @@ public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiExcep * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call getOrderByIdAsync(Long orderId, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call getOrderByIdAsync(Integer orderId, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -409,17 +452,19 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for placeOrder - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call placeOrderCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - + public com.squareup.okhttp.Call placeOrderCall(Order order, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = order; + // create path and map variables String localVarPath = "/store/order"; @@ -437,7 +482,7 @@ public com.squareup.okhttp.Call placeOrderCall(Order body, final ProgressRespons if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -457,42 +502,51 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call placeOrderValidateBeforeCall(Order body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call placeOrderValidateBeforeCall(Order order, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling placeOrder(Async)"); + // verify the required parameter 'order' is set + if (order == null) { + throw new ApiException("Missing the required parameter 'order' when calling placeOrder(Async)"); } - - com.squareup.okhttp.Call call = placeOrderCall(body, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = placeOrderCall(order, progressListener, progressRequestListener); return call; + + + + + + } /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return Order * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public Order placeOrder(Order body) throws ApiException { - ApiResponse resp = placeOrderWithHttpInfo(body); + public Order placeOrder(Order order) throws ApiException { + ApiResponse resp = placeOrderWithHttpInfo(order); return resp.getData(); } /** * Place an order for a pet * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return ApiResponse<Order> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse placeOrderWithHttpInfo(Order body) throws ApiException { - com.squareup.okhttp.Call call = placeOrderValidateBeforeCall(body, null, null); + public ApiResponse placeOrderWithHttpInfo(Order order) throws ApiException { + com.squareup.okhttp.Call call = placeOrderValidateBeforeCall(order, null, null); Type localVarReturnType = new TypeToken(){}.getType(); return apiClient.execute(call, localVarReturnType); } @@ -500,12 +554,13 @@ public ApiResponse placeOrderWithHttpInfo(Order body) throws ApiException /** * Place an order for a pet (asynchronously) * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call placeOrderAsync(Order body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call placeOrderAsync(Order order, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -526,9 +581,10 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = placeOrderValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = placeOrderValidateBeforeCall(order, progressListener, progressRequestListener); Type localVarReturnType = new TypeToken(){}.getType(); apiClient.executeAsync(call, localVarReturnType, callback); return call; } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/UserApi.java index d0f16373bec..971b2f095f3 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/api/UserApi.java @@ -22,19 +22,26 @@ import io.swagger.client.ProgressRequestBody; import io.swagger.client.ProgressResponseBody; + import com.google.gson.reflect.TypeToken; import java.io.IOException; + + import io.swagger.client.model.User; + import java.lang.reflect.Type; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + + public class UserApi { private ApiClient apiClient; @@ -54,17 +61,19 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** * Build call for createUser - * @param body Created user object (required) + * @param user Created user object (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call createUserCall(User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - + public com.squareup.okhttp.Call createUserCall(User user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = user; + // create path and map variables String localVarPath = "/user"; @@ -76,13 +85,13 @@ public com.squareup.okhttp.Call createUserCall(User body, final ProgressResponse Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -102,52 +111,62 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call createUserValidateBeforeCall(User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call createUserValidateBeforeCall(User user, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling createUser(Async)"); + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling createUser(Async)"); } - - com.squareup.okhttp.Call call = createUserCall(body, progressListener, progressRequestListener); + + com.squareup.okhttp.Call call = createUserCall(user, progressListener, progressRequestListener); return call; + + + + + + } /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public void createUser(User body) throws ApiException { - createUserWithHttpInfo(body); + public void createUser(User user) throws ApiException { + createUserWithHttpInfo(user); } /** * Create user * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse createUserWithHttpInfo(User body) throws ApiException { - com.squareup.okhttp.Call call = createUserValidateBeforeCall(body, null, null); + public ApiResponse createUserWithHttpInfo(User user) throws ApiException { + com.squareup.okhttp.Call call = createUserValidateBeforeCall(user, null, null); return apiClient.execute(call); } /** * Create user (asynchronously) * This can only be done by the logged in user. - * @param body Created user object (required) + * @param user Created user object (required) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call createUserAsync(User body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call createUserAsync(User user, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -168,10 +187,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = createUserValidateBeforeCall(body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = createUserValidateBeforeCall(user, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } + /** * Build call for createUsersWithArrayInput * @param body List of user object (required) @@ -179,10 +199,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call createUsersWithArrayInputCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; - + // create path and map variables String localVarPath = "/user/createWithArray"; @@ -194,13 +215,13 @@ public com.squareup.okhttp.Call createUsersWithArrayInputCall(List body, f Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -220,19 +241,26 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call createUsersWithArrayInputValidateBeforeCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling createUsersWithArrayInput(Async)"); } - + com.squareup.okhttp.Call call = createUsersWithArrayInputCall(body, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -240,6 +268,7 @@ private com.squareup.okhttp.Call createUsersWithArrayInputValidateBeforeCall(Lis * * @param body List of user object (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public void createUsersWithArrayInput(List body) throws ApiException { createUsersWithArrayInputWithHttpInfo(body); @@ -251,6 +280,7 @@ public void createUsersWithArrayInput(List body) throws ApiException { * @param body List of user object (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse createUsersWithArrayInputWithHttpInfo(List body) throws ApiException { com.squareup.okhttp.Call call = createUsersWithArrayInputValidateBeforeCall(body, null, null); @@ -264,6 +294,7 @@ public ApiResponse createUsersWithArrayInputWithHttpInfo(List body) * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call createUsersWithArrayInputAsync(List body, final ApiCallback callback) throws ApiException { @@ -290,6 +321,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, callback); return call; } + /** * Build call for createUsersWithListInput * @param body List of user object (required) @@ -297,10 +329,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call createUsersWithListInputCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = body; - + // create path and map variables String localVarPath = "/user/createWithList"; @@ -312,13 +345,13 @@ public com.squareup.okhttp.Call createUsersWithListInputCall(List body, fi Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -338,19 +371,26 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call createUsersWithListInputValidateBeforeCall(List body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'body' is set if (body == null) { throw new ApiException("Missing the required parameter 'body' when calling createUsersWithListInput(Async)"); } - + com.squareup.okhttp.Call call = createUsersWithListInputCall(body, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -358,6 +398,7 @@ private com.squareup.okhttp.Call createUsersWithListInputValidateBeforeCall(List * * @param body List of user object (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public void createUsersWithListInput(List body) throws ApiException { createUsersWithListInputWithHttpInfo(body); @@ -369,6 +410,7 @@ public void createUsersWithListInput(List body) throws ApiException { * @param body List of user object (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse createUsersWithListInputWithHttpInfo(List body) throws ApiException { com.squareup.okhttp.Call call = createUsersWithListInputValidateBeforeCall(body, null, null); @@ -382,6 +424,7 @@ public ApiResponse createUsersWithListInputWithHttpInfo(List body) t * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call createUsersWithListInputAsync(List body, final ApiCallback callback) throws ApiException { @@ -408,6 +451,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, callback); return call; } + /** * Build call for deleteUser * @param username The name that needs to be deleted (required) @@ -415,10 +459,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call deleteUserCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); @@ -431,7 +476,7 @@ public com.squareup.okhttp.Call deleteUserCall(String username, final ProgressRe Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -457,19 +502,26 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call deleteUserValidateBeforeCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling deleteUser(Async)"); } - + com.squareup.okhttp.Call call = deleteUserCall(username, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -477,6 +529,7 @@ private com.squareup.okhttp.Call deleteUserValidateBeforeCall(String username, f * This can only be done by the logged in user. * @param username The name that needs to be deleted (required) * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public void deleteUser(String username) throws ApiException { deleteUserWithHttpInfo(username); @@ -488,6 +541,7 @@ public void deleteUser(String username) throws ApiException { * @param username The name that needs to be deleted (required) * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { com.squareup.okhttp.Call call = deleteUserValidateBeforeCall(username, null, null); @@ -501,6 +555,7 @@ public ApiResponse deleteUserWithHttpInfo(String username) throws ApiExcep * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call deleteUserAsync(String username, final ApiCallback callback) throws ApiException { @@ -527,6 +582,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, callback); return call; } + /** * Build call for getUserByName * @param username The name that needs to be fetched. Use user1 for testing. (required) @@ -534,10 +590,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call getUserByNameCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); @@ -576,19 +633,26 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call getUserByNameValidateBeforeCall(String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling getUserByName(Async)"); } - + com.squareup.okhttp.Call call = getUserByNameCall(username, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -597,6 +661,7 @@ private com.squareup.okhttp.Call getUserByNameValidateBeforeCall(String username * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return User * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public User getUserByName(String username) throws ApiException { ApiResponse resp = getUserByNameWithHttpInfo(username); @@ -609,6 +674,7 @@ public User getUserByName(String username) throws ApiException { * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return ApiResponse<User> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { com.squareup.okhttp.Call call = getUserByNameValidateBeforeCall(username, null, null); @@ -623,6 +689,7 @@ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiEx * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call getUserByNameAsync(String username, final ApiCallback callback) throws ApiException { @@ -650,6 +717,7 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for loginUser * @param username The user name for login (required) @@ -658,10 +726,11 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call loginUserCall(String username, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/user/login"; @@ -703,10 +772,11 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call loginUserValidateBeforeCall(String username, String password, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling loginUser(Async)"); @@ -717,10 +787,16 @@ private com.squareup.okhttp.Call loginUserValidateBeforeCall(String username, St throw new ApiException("Missing the required parameter 'password' when calling loginUser(Async)"); } - + com.squareup.okhttp.Call call = loginUserCall(username, password, progressListener, progressRequestListener); return call; + + + + + + } /** @@ -730,6 +806,7 @@ private com.squareup.okhttp.Call loginUserValidateBeforeCall(String username, St * @param password The password for login in clear text (required) * @return String * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public String loginUser(String username, String password) throws ApiException { ApiResponse resp = loginUserWithHttpInfo(username, password); @@ -743,6 +820,7 @@ public String loginUser(String username, String password) throws ApiException { * @param password The password for login in clear text (required) * @return ApiResponse<String> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { com.squareup.okhttp.Call call = loginUserValidateBeforeCall(username, password, null, null); @@ -758,6 +836,7 @@ public ApiResponse loginUserWithHttpInfo(String username, String passwor * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call loginUserAsync(String username, String password, final ApiCallback callback) throws ApiException { @@ -785,16 +864,18 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, localVarReturnType, callback); return call; } + /** * Build call for logoutUser * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ public com.squareup.okhttp.Call logoutUserCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/user/logout"; @@ -806,7 +887,7 @@ public com.squareup.okhttp.Call logoutUserCall(final ProgressResponseBody.Progre Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); @@ -832,20 +913,28 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") private com.squareup.okhttp.Call logoutUserValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - + + com.squareup.okhttp.Call call = logoutUserCall(progressListener, progressRequestListener); return call; + + + + + + } /** * Logs out current logged in user session * * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public void logoutUser() throws ApiException { logoutUserWithHttpInfo(); @@ -856,6 +945,7 @@ public void logoutUser() throws ApiException { * * @return ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ public ApiResponse logoutUserWithHttpInfo() throws ApiException { com.squareup.okhttp.Call call = logoutUserValidateBeforeCall(null, null); @@ -868,6 +958,7 @@ public ApiResponse logoutUserWithHttpInfo() throws ApiException { * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ public com.squareup.okhttp.Call logoutUserAsync(final ApiCallback callback) throws ApiException { @@ -894,18 +985,20 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don apiClient.executeAsync(call, callback); return call; } + /** * Build call for updateUser + * @param user Updated user object (required) * @param username name that need to be deleted (required) - * @param body Updated user object (required) * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object + */ - public com.squareup.okhttp.Call updateUserCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { - Object localVarPostBody = body; - + public com.squareup.okhttp.Call updateUserCall(User user, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = user; + // create path and map variables String localVarPath = "/user/{username}" .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); @@ -918,13 +1011,13 @@ public com.squareup.okhttp.Call updateUserCall(String username, User body, final Map localVarFormParams = new HashMap(); final String[] localVarAccepts = { - "application/xml", "application/json" + }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { - + "*/*" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); @@ -944,60 +1037,70 @@ public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Ch String[] localVarAuthNames = new String[] { }; return apiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } - + @SuppressWarnings("rawtypes") - private com.squareup.okhttp.Call updateUserValidateBeforeCall(String username, User body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + private com.squareup.okhttp.Call updateUserValidateBeforeCall(User user, String username, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException("Missing the required parameter 'user' when calling updateUser(Async)"); + } // verify the required parameter 'username' is set if (username == null) { throw new ApiException("Missing the required parameter 'username' when calling updateUser(Async)"); } - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException("Missing the required parameter 'body' when calling updateUser(Async)"); - } - - com.squareup.okhttp.Call call = updateUserCall(username, body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = updateUserCall(user, username, progressListener, progressRequestListener); return call; + + + + + + } /** * 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 fail to call the API, e.g. server error or cannot deserialize the response body + */ - public void updateUser(String username, User body) throws ApiException { - updateUserWithHttpInfo(username, body); + public void updateUser(User user, String username) throws ApiException { + updateUserWithHttpInfo(user, username); } /** * 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 ApiResponse<Void> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ - public ApiResponse updateUserWithHttpInfo(String username, User body) throws ApiException { - com.squareup.okhttp.Call call = updateUserValidateBeforeCall(username, body, null, null); + public ApiResponse updateUserWithHttpInfo(User user, String username) throws ApiException { + com.squareup.okhttp.Call call = updateUserValidateBeforeCall(user, username, null, null); return apiClient.execute(call); } /** * Updated user (asynchronously) * 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 callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ - public com.squareup.okhttp.Call updateUserAsync(String username, User body, final ApiCallback callback) throws ApiException { + public com.squareup.okhttp.Call updateUserAsync(User user, String username, final ApiCallback callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -1018,8 +1121,9 @@ public void onRequestProgress(long bytesWritten, long contentLength, boolean don }; } - com.squareup.okhttp.Call call = updateUserValidateBeforeCall(username, body, progressListener, progressRequestListener); + com.squareup.okhttp.Call call = updateUserValidateBeforeCall(user, username, progressListener, progressRequestListener); apiClient.executeAsync(call, callback); return call; } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index b302fdf6012..56510d9ad3c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java index f65c5bffcb3..7d0184c4016 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Animal.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/AnimalFarm.java deleted file mode 100644 index 0b1d6a74cc6..00000000000 --- a/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index f9956fe46d8..6072a884b8b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index c79610d1c66..9d03a82a520 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayTest.java index 747182e792e..16a6ebcc6f0 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ArrayTest.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Capitalization.java index 00c564ab727..2c7727d7261 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Capitalization.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java index 64d3fbdc7fe..b093e138ba6 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Cat.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Category.java index 4e9f8f56e5e..42e198faaff 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Category.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ClassModel.java index 4cf0a053250..627c102a69a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ClassModel.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Client.java index 43b20dce8da..460c9e52ba1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Client.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java index 8fad06d9835..4d52b28512f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Dog.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumArrays.java index 5f063c2ec38..43000487324 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumArrays.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumClass.java index 3c19333c1ce..80a5d20a545 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java index fb20599a85c..4ca2772ab1b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java index ddb80771fda..9979fcd8cc3 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/FormatTest.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 1b7ff181941..ddb6837fecb 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MapTest.java index a791e68d8fb..29e18228896 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MapTest.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 7c99abe53eb..9efda42416f 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Model200Response.java index 0d39eb7eff5..66416f6c0cb 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Model200Response.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelApiResponse.java index 3d9352c50aa..5217ac1d2ea 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelReturn.java index ab6333ff86d..21d717b8076 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelReturn.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Name.java index 1492add2952..c631e933a60 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Name.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/NumberOnly.java index b13c0536a13..0468fa26f78 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/NumberOnly.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Order.java index 4dcf75a7cd0..6192a446f0a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Order.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterComposite.java index 56159fe5d93..039a870d41b 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterEnum.java index 3b24acc6b51..2bb0d8fcb27 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/okhttp-gson/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/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java index dac1250ac07..2b91dae9614 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Pet.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index f6e025412de..c7c8eb90968 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/SpecialModelName.java index e743292100b..3e2312615c2 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Tag.java index bb6de58c8a1..b032d15676a 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Tag.java @@ -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/okhttp-gson/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/User.java index 4ccb8a1c147..75e44e2ff37 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/User.java @@ -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/okhttp-gson/src/test/java/io/swagger/TestUtils.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/TestUtils.java deleted file mode 100644 index 7ddf142426e..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/TestUtils.java +++ /dev/null @@ -1,17 +0,0 @@ -package io.swagger; - -import java.util.Random; -import java.util.concurrent.atomic.AtomicLong; - -public class TestUtils { - private static final AtomicLong atomicId = createAtomicId(); - - public static long nextId() { - return atomicId.getAndIncrement(); - } - - private static AtomicLong createAtomicId() { - int baseId = new Random(System.currentTimeMillis()).nextInt(1000000) + 20000; - return new AtomicLong((long) baseId); - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/ApiClientTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/ApiClientTest.java deleted file mode 100644 index e793075224b..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/ApiClientTest.java +++ /dev/null @@ -1,330 +0,0 @@ -package io.swagger.client; - -import io.swagger.client.auth.*; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.*; -import java.util.TimeZone; - -import org.junit.*; -import static org.junit.Assert.*; - - -public class ApiClientTest { - ApiClient apiClient; - JSON json; - - @Before - public void setup() { - apiClient = new ApiClient(); - json = apiClient.getJSON(); - } - - @Test - public void testIsJsonMime() { - assertFalse(apiClient.isJsonMime(null)); - assertFalse(apiClient.isJsonMime("")); - assertFalse(apiClient.isJsonMime("text/plain")); - assertFalse(apiClient.isJsonMime("application/xml")); - assertFalse(apiClient.isJsonMime("application/jsonp")); - assertFalse(apiClient.isJsonMime("example/json")); - assertFalse(apiClient.isJsonMime("example/foo+bar+jsonx")); - assertFalse(apiClient.isJsonMime("example/foo+bar+xjson")); - - assertTrue(apiClient.isJsonMime("application/json")); - assertTrue(apiClient.isJsonMime("application/json; charset=UTF8")); - assertTrue(apiClient.isJsonMime("APPLICATION/JSON")); - - assertTrue(apiClient.isJsonMime("application/problem+json")); - assertTrue(apiClient.isJsonMime("APPLICATION/PROBLEM+JSON")); - assertTrue(apiClient.isJsonMime("application/json\t")); - assertTrue(apiClient.isJsonMime("example/foo+bar+json")); - assertTrue(apiClient.isJsonMime("example/foo+json;x;y")); - assertTrue(apiClient.isJsonMime("example/foo+json\t;")); - assertTrue(apiClient.isJsonMime("Example/fOO+JSON")); - - assertTrue(apiClient.isJsonMime("application/json-patch+json")); - } - - @Test - public void testSelectHeaderAccept() { - String[] accepts = {"application/json", "application/xml"}; - assertEquals("application/json", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"APPLICATION/XML", "APPLICATION/JSON"}; - assertEquals("APPLICATION/JSON", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"application/xml", "application/json; charset=UTF8"}; - assertEquals("application/json; charset=UTF8", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{"text/plain", "application/xml"}; - assertEquals("text/plain,application/xml", apiClient.selectHeaderAccept(accepts)); - - accepts = new String[]{}; - assertNull(apiClient.selectHeaderAccept(accepts)); - } - - @Test - public void testSelectHeaderContentType() { - String[] contentTypes = {"application/json", "application/xml"}; - assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"APPLICATION/JSON", "APPLICATION/XML"}; - assertEquals("APPLICATION/JSON", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"application/xml", "application/json; charset=UTF8"}; - assertEquals("application/json; charset=UTF8", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{"text/plain", "application/xml"}; - assertEquals("text/plain", apiClient.selectHeaderContentType(contentTypes)); - - contentTypes = new String[]{}; - assertEquals("application/json", apiClient.selectHeaderContentType(contentTypes)); - } - - @Test - public void testGetAuthentications() { - Map auths = apiClient.getAuthentications(); - - Authentication auth = auths.get("api_key"); - assertNotNull(auth); - assertTrue(auth instanceof ApiKeyAuth); - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) auth; - assertEquals("header", apiKeyAuth.getLocation()); - assertEquals("api_key", apiKeyAuth.getParamName()); - - auth = auths.get("petstore_auth"); - assertTrue(auth instanceof OAuth); - assertSame(auth, apiClient.getAuthentication("petstore_auth")); - - assertNull(auths.get("unknown")); - - try { - auths.put("my_auth", new HttpBasicAuth()); - fail("the authentications returned should not be modifiable"); - } catch (UnsupportedOperationException e) { - } - } - - /* - @Test - public void testSetUsernameAndPassword() { - HttpBasicAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof HttpBasicAuth) { - auth = (HttpBasicAuth) _auth; - break; - } - } - auth.setUsername(null); - auth.setPassword(null); - - apiClient.setUsername("my-username"); - apiClient.setPassword("my-password"); - assertEquals("my-username", auth.getUsername()); - assertEquals("my-password", auth.getPassword()); - - // reset values - auth.setUsername(null); - auth.setPassword(null); - } - */ - - @Test - public void testSetApiKeyAndPrefix() { - ApiKeyAuth auth = null; - for (Authentication _auth : apiClient.getAuthentications().values()) { - if (_auth instanceof ApiKeyAuth) { - auth = (ApiKeyAuth) _auth; - break; - } - } - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - - apiClient.setApiKey("my-api-key"); - apiClient.setApiKeyPrefix("Token"); - assertEquals("my-api-key", auth.getApiKey()); - assertEquals("Token", auth.getApiKeyPrefix()); - - // reset values - auth.setApiKey(null); - auth.setApiKeyPrefix(null); - } - - @Test - public void testGetAndSetConnectTimeout() { - // connect timeout defaults to 10 seconds - assertEquals(10000, apiClient.getConnectTimeout()); - assertEquals(10000, apiClient.getHttpClient().getConnectTimeout()); - - apiClient.setConnectTimeout(0); - assertEquals(0, apiClient.getConnectTimeout()); - assertEquals(0, apiClient.getHttpClient().getConnectTimeout()); - - apiClient.setConnectTimeout(10000); - } - - @Test - public void testGetAndSetReadTimeout() { - // read timeout defaults to 10 seconds - assertEquals(10000, apiClient.getReadTimeout()); - assertEquals(10000, apiClient.getHttpClient().getReadTimeout()); - - apiClient.setReadTimeout(0); - assertEquals(0, apiClient.getReadTimeout()); - assertEquals(0, apiClient.getHttpClient().getReadTimeout()); - - apiClient.setReadTimeout(10000); - } - - @Test - public void testGetAndSetWriteTimeout() { - // write timeout defaults to 10 seconds - assertEquals(10000, apiClient.getWriteTimeout()); - assertEquals(10000, apiClient.getHttpClient().getWriteTimeout()); - - apiClient.setWriteTimeout(0); - assertEquals(0, apiClient.getWriteTimeout()); - assertEquals(0, apiClient.getHttpClient().getWriteTimeout()); - - apiClient.setWriteTimeout(10000); - } - - @Test - public void testParameterToPairWhenNameIsInvalid() throws Exception { - List pairs_a = apiClient.parameterToPair(null, new Integer(1)); - List pairs_b = apiClient.parameterToPair("", new Integer(1)); - - assertTrue(pairs_a.isEmpty()); - assertTrue(pairs_b.isEmpty()); - } - - @Test - public void testParameterToPairWhenValueIsNull() throws Exception { - List pairs = apiClient.parameterToPair("param-a", null); - - assertTrue(pairs.isEmpty()); - } - - @Test - public void testParameterToPairWhenValueIsEmptyString() throws Exception { - // single empty string - List pairs = apiClient.parameterToPair("param-a", " "); - assertEquals(1, pairs.size()); - } - - @Test - public void testParameterToPairWhenValueIsNotCollection() throws Exception { - String name = "param-a"; - Integer value = 1; - - List pairs = apiClient.parameterToPair(name, value); - - assertEquals(1, pairs.size()); - assertEquals(value, Integer.valueOf(pairs.get(0).getValue())); - } - - @Test - public void testParameterToPairWhenValueIsCollection() throws Exception { - List values = new ArrayList(); - values.add("value-a"); - values.add(123); - values.add(new Date()); - - List pairs = apiClient.parameterToPair("param-a", values); - assertEquals(0, pairs.size()); - } - - @Test - public void testParameterToPairsWhenNameIsInvalid() throws Exception { - List objects = new ArrayList(); - objects.add(new Integer(1)); - - List pairs_a = apiClient.parameterToPairs("csv", null, objects); - List pairs_b = apiClient.parameterToPairs("csv", "", objects); - - assertTrue(pairs_a.isEmpty()); - assertTrue(pairs_b.isEmpty()); - } - - @Test - public void testParameterToPairsWhenValueIsNull() throws Exception { - List pairs = apiClient.parameterToPairs("csv", "param-a", null); - - assertTrue(pairs.isEmpty()); - } - - @Test - public void testParameterToPairsWhenValueIsEmptyStrings() throws Exception { - // list of empty strings - List strs = new ArrayList(); - strs.add(" "); - strs.add(" "); - strs.add(" "); - - List concatStrings = apiClient.parameterToPairs("csv", "param-a", strs); - - assertEquals(1, concatStrings.size()); - assertFalse(concatStrings.get(0).getValue().isEmpty()); // should contain some delimiters - } - - @Test - public void testParameterToPairsWhenValueIsCollection() throws Exception { - Map collectionFormatMap = new HashMap(); - collectionFormatMap.put("csv", ","); - collectionFormatMap.put("tsv", "\t"); - collectionFormatMap.put("ssv", " "); - collectionFormatMap.put("pipes", "|"); - collectionFormatMap.put("", ","); // no format, must default to csv - collectionFormatMap.put("unknown", ","); // all other formats, must default to csv - - String name = "param-a"; - - List values = new ArrayList(); - values.add("value-a"); - values.add(123); - values.add(new Date()); - - // check for multi separately - List multiPairs = apiClient.parameterToPairs("multi", name, values); - assertEquals(values.size(), multiPairs.size()); - for (int i = 0; i < values.size(); i++) { - assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), multiPairs.get(i).getValue()); - } - - // all other formats - for (String collectionFormat : collectionFormatMap.keySet()) { - List pairs = apiClient.parameterToPairs(collectionFormat, name, values); - - assertEquals(1, pairs.size()); - - String delimiter = collectionFormatMap.get(collectionFormat); - if (!delimiter.equals(",")) { - // commas are not escaped because they are reserved characters in URIs - delimiter = apiClient.escapeString(delimiter); - } - String[] pairValueSplit = pairs.get(0).getValue().split(delimiter); - - // must equal input values - assertEquals(values.size(), pairValueSplit.length); - for (int i = 0; i < values.size(); i++) { - assertEquals(apiClient.escapeString(apiClient.parameterToString(values.get(i))), pairValueSplit[i]); - } - } - } - - @Test - public void testSanitizeFilename() { - assertEquals("sun", apiClient.sanitizeFilename("sun")); - assertEquals("sun.gif", apiClient.sanitizeFilename("sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("../sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("/var/tmp/sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("./sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("..\\sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("\\var\\tmp\\sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename("c:\\var\\tmp\\sun.gif")); - assertEquals("sun.gif", apiClient.sanitizeFilename(".\\sun.gif")); - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/ConfigurationTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/ConfigurationTest.java deleted file mode 100644 index ccdf25feb30..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/ConfigurationTest.java +++ /dev/null @@ -1,15 +0,0 @@ -package io.swagger.client; - -import org.junit.*; -import static org.junit.Assert.*; - - -public class ConfigurationTest { - @Test - public void testDefaultApiClient() { - ApiClient apiClient = Configuration.getDefaultApiClient(); - assertNotNull(apiClient); - assertEquals("http://petstore.swagger.io:80/v2", apiClient.getBasePath()); - assertFalse(apiClient.isDebugging()); - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/JSONTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/JSONTest.java deleted file mode 100644 index bd95b8b94b3..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/JSONTest.java +++ /dev/null @@ -1,149 +0,0 @@ -package io.swagger.client; - -import com.google.gson.reflect.TypeToken; - -import io.swagger.client.model.Order; - -import java.lang.Exception; -import java.lang.reflect.Type; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -import org.junit.*; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZoneOffset; -import org.threeten.bp.format.DateTimeFormatter; - -import static org.junit.Assert.*; - -public class JSONTest { - private ApiClient apiClient = null; - private JSON json = null; - private Order order = null; - - @Before - public void setup() { - apiClient = new ApiClient(); - json = apiClient.getJSON(); - order = new Order(); - } - - @Test - public void testSqlDateTypeAdapter() { - final String str = "\"2015-11-07\""; - final java.sql.Date date = java.sql.Date.valueOf("2015-11-07"); - - assertEquals(str, json.serialize(date)); - assertEquals(json.deserialize(str, java.sql.Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.356+00:00\"", java.sql.Date.class).toString(), date.toString()); - - // custom date format: without day - DateFormat format = new SimpleDateFormat("yyyy-MM"); - apiClient.setSqlDateFormat(format); - String dateStr = "\"2015-11\""; - assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09Z\"", java.sql.Date.class))); - assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11\"", java.sql.Date.class))); - } - - @Test - public void testDateTypeAdapter() { - Calendar cal = new GregorianCalendar(2015, 10, 7, 3, 49, 9); - cal.setTimeZone(TimeZone.getTimeZone("UTC")); - - assertEquals(json.deserialize("\"2015-11-07T05:49:09+02\"", Date.class), cal.getTime()); - - cal.set(Calendar.MILLISECOND, 300); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.3Z\"", Date.class), cal.getTime()); - - cal.set(Calendar.MILLISECOND, 356); - Date date = cal.getTime(); - - final String utcDate = "\"2015-11-07T03:49:09.356Z\""; - assertEquals(json.deserialize(utcDate, Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.356+00:00\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T05:49:09.356+02:00\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T02:49:09.356-01:00\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.356Z\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.356+00\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T02:49:09.356-0100\"", Date.class), date); - assertEquals(json.deserialize("\"2015-11-07T03:49:09.356456789Z\"", Date.class), date); - - assertEquals(utcDate, json.serialize(date)); - - // custom datetime format: without milli-seconds, custom time zone - DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX"); - format.setTimeZone(TimeZone.getTimeZone("GMT+10")); - apiClient.setDateFormat(format); - - String dateStr = "\"2015-11-07T13:49:09+10:00\""; - assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09+00:00\"", Date.class))); - assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09Z\"", Date.class))); - assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T00:49:09-03:00\"", Date.class))); - - try { - // invalid time zone format - json.deserialize("\"2015-11-07T03:49:09+00\"", Date.class); - fail("json parsing should fail"); - } catch (RuntimeException e) { - // OK - } - try { - // unexpected miliseconds - json.deserialize("\"2015-11-07T03:49:09.000Z\"", Date.class); - fail("json parsing should fail"); - } catch (RuntimeException e) { - // OK - } - - } - - @Test - public void testOffsetDateTimeTypeAdapter() { - final String str = "\"2016-09-09T08:02:03.123-03:00\""; - OffsetDateTime date = OffsetDateTime.of(2016, 9, 9, 8, 2, 3, 123000000, ZoneOffset.of("-3")); - - assertEquals(str, json.serialize(date)); - //Use toString() instead of isEqual to verify that the offset is preserved - assertEquals(json.deserialize(str, OffsetDateTime.class).toString(), date.toString()); - } - - @Test - public void testLocalDateTypeAdapter() { - final String str = "\"2016-09-09\""; - final LocalDate date = LocalDate.of(2016, 9, 9); - - assertEquals(str, json.serialize(date)); - assertEquals(json.deserialize(str, LocalDate.class), date); - } - - - @Test - public void testDefaultDate() throws Exception { - final DateTimeFormatter datetimeFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME; - final String dateStr = "2015-11-07T14:11:05.267Z"; - order.setShipDate(datetimeFormat.parse(dateStr, OffsetDateTime.FROM)); - - String str = json.serialize(order); - Type type = new TypeToken() { }.getType(); - Order o = json.deserialize(str, type); - assertEquals(dateStr, datetimeFormat.format(o.getShipDate())); - } - - @Test - public void testCustomDate() throws Exception { - final DateTimeFormatter datetimeFormat = DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneId.of("Etc/GMT+2")); - final String dateStr = "2015-11-07T14:11:05-02:00"; - order.setShipDate(datetimeFormat.parse(dateStr, OffsetDateTime.FROM)); - - String str = json.serialize(order); - Type type = new TypeToken() { }.getType(); - Order o = json.deserialize(str, type); - assertEquals(dateStr, datetimeFormat.format(o.getShipDate())); - } -} \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/StringUtilTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/StringUtilTest.java deleted file mode 100644 index 4b03c7a9812..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/StringUtilTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package io.swagger.client; - -import org.junit.*; -import static org.junit.Assert.*; - - -public class StringUtilTest { - @Test - public void testContainsIgnoreCase() { - assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "abc")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{"abc"}, "ABC")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{"ABC"}, "abc")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, "ABC")); - assertTrue(StringUtil.containsIgnoreCase(new String[]{null, "abc"}, null)); - - assertFalse(StringUtil.containsIgnoreCase(new String[]{"abc"}, "def")); - assertFalse(StringUtil.containsIgnoreCase(new String[]{}, "ABC")); - assertFalse(StringUtil.containsIgnoreCase(new String[]{}, null)); - } - - @Test - public void testJoin() { - String[] array = {"aa", "bb", "cc"}; - assertEquals("aa,bb,cc", StringUtil.join(array, ",")); - assertEquals("aa, bb, cc", StringUtil.join(array, ", ")); - assertEquals("aabbcc", StringUtil.join(array, "")); - assertEquals("aa bb cc", StringUtil.join(array, " ")); - assertEquals("aa\nbb\ncc", StringUtil.join(array, "\n")); - - assertEquals("", StringUtil.join(new String[]{}, ",")); - assertEquals("abc", StringUtil.join(new String[]{"abc"}, ",")); - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java index a5339a392d2..f2b031f9485 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java @@ -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/okhttp-gson/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/FakeApiTest.java index c564001ad70..9710cbe6764 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -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/okhttp-gson/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index af5885aaddd..dbda3faa692 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -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/okhttp-gson/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/PetApiTest.java index b949d90ebdb..f02c13872eb 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/PetApiTest.java @@ -1,393 +1,189 @@ +/* + * 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.ModelApiResponse; +import io.swagger.client.model.Pet; + +import org.junit.Test; +import org.junit.Ignore; -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.lang.reflect.Type; import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.junit.*; -import static org.junit.Assert.*; +/** + * API tests for PetApi + */ +@Ignore public class PetApiTest { - PetApi api = null; - - @Before - public void setup() { - api = new PetApi(); - // setup authentication - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) api.getApiClient().getAuthentication("api_key"); - apiKeyAuth.setApiKey("special-key"); - } - - @Test - public void testApiClient() { - // the default api client is used - assertEquals(Configuration.getDefaultApiClient(), api.getApiClient()); - assertNotNull(api.getApiClient()); - assertEquals("http://petstore.swagger.io:80/v2", api.getApiClient().getBasePath()); - assertFalse(api.getApiClient().isDebugging()); - - ApiClient oldClient = api.getApiClient(); - - ApiClient newClient = new ApiClient(); - newClient.setBasePath("http://example.com"); - newClient.setDebugging(true); - - // set api client via constructor - api = new PetApi(newClient); - assertNotNull(api.getApiClient()); - assertEquals("http://example.com", api.getApiClient().getBasePath()); - assertTrue(api.getApiClient().isDebugging()); - - // set api client via setter method - api.setApiClient(oldClient); - assertNotNull(api.getApiClient()); - assertEquals("http://petstore.swagger.io:80/v2", api.getApiClient().getBasePath()); - assertFalse(api.getApiClient().isDebugging()); - } + 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, api.getApiClient()).getBytes(); - api.addPetUsingByteArray(bytes); - - byte[] fetchedBytes = api.petPetIdtestingByteArraytrueGet(pet.getId()); - Type type = new TypeToken(){}.getType(); - Pet fetched = deserializeJson(new String(fetchedBytes), type, api.getApiClient()); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); - } - */ - + 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 testCreateAndGetPetWithHttpInfo() throws Exception { - Pet pet = createRandomPet(); - api.addPetWithHttpInfo(pet); - - ApiResponse resp = api.getPetByIdWithHttpInfo(pet.getId()); - assertEquals(200, resp.getStatusCode()); - assertEquals("application/json", resp.getHeaders().get("Content-Type").get(0)); - Pet fetched = resp.getData(); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); - } - + 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 testCreateAndGetPetAsync() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet); - // to store returned Pet or error message/exception - final Map result = new HashMap(); - - api.getPetByIdAsync(pet.getId(), new ApiCallback() { - @Override - public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { - result.put("error", e.getMessage()); - } - - @Override - public void onSuccess(Pet pet, int statusCode, Map> responseHeaders) { - result.put("pet", pet); - } - - @Override - public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { - //empty - } - - @Override - public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { - //empty - } - }); - // the API call should be executed asynchronously, so result should be empty at the moment - assertTrue(result.isEmpty()); - - // wait for the asynchronous call to finish (at most 10 seconds) - final int maxTry = 10; - int tryCount = 1; - Pet fetched = null; - do { - if (tryCount > maxTry) fail("have not got result of getPetByIdAsync after 10 seconds"); - Thread.sleep(1000); - tryCount += 1; - if (result.get("error") != null) fail((String) result.get("error")); - if (result.get("pet") != null) { - fetched = (Pet) result.get("pet"); - break; - } - } while (result.isEmpty()); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); - - // test getting a nonexistent pet - result.clear(); - api.getPetByIdAsync(-10000L, new ApiCallback() { - @Override - public void onFailure(ApiException e, int statusCode, Map> responseHeaders) { - result.put("exception", e); - } - - @Override - public void onSuccess(Pet pet, int statusCode, Map> responseHeaders) { - result.put("pet", pet); - } - - @Override - public void onUploadProgress(long bytesWritten, long contentLength, boolean done) { - //empty - } - - @Override - public void onDownloadProgress(long bytesRead, long contentLength, boolean done) { - //empty - } - }); - - // wait for the asynchronous call to finish (at most 10 seconds) - tryCount = 1; - ApiException exception = null; - do { - if (tryCount > maxTry) fail("have not got result of getPetByIdAsync after 10 seconds"); - Thread.sleep(1000); - tryCount += 1; - if (result.get("pet") != null) fail("expected an error"); - if (result.get("exception") != null) { - exception = (ApiException) result.get("exception"); - break; - } - } while (result.isEmpty()); - assertNotNull(exception); - assertEquals(404, exception.getCode()); - assertEquals("Not Found", exception.getMessage()); - assertEquals("application/json", exception.getResponseHeaders().get("Content-Type").get(0)); - } - - /* + 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 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); - - api.addPet(pet); - - InlineResponse200 fetched = api.getPetByIdInObject(pet.getId()); - assertEquals(pet.getId(), fetched.getId()); - assertEquals(pet.getName(), fetched.getName()); - - Object categoryObj = fetched.getCategory(); - assertNotNull(categoryObj); - assertTrue(categoryObj instanceof Map); - - Map categoryMap = (Map) categoryObj; - Object categoryIdObj = categoryMap.get("id"); - // NOTE: Gson parses integer value to double. - assertTrue(categoryIdObj instanceof Double); - Long categoryIdLong = ((Double) categoryIdObj).longValue(); - assertEquals(category.getId(), categoryIdLong); - assertEquals(category.getName(), categoryMap.get("name")); - } - */ - + 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 testUpdatePet() throws Exception { - Pet pet = createRandomPet(); - pet.setName("programmer"); - + public void updatePetTest() throws ApiException { + + Pet pet = null; + api.updatePet(pet); - Pet fetched = api.getPetById(pet.getId()); - assertNotNull(fetched); - assertEquals(pet.getId(), fetched.getId()); - assertNotNull(fetched.getCategory()); - assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); - } - + // TODO: test validations + } + + /** + * Updates a pet in the store with form data + * + * + * + * @throws ApiException + * if the Api call fails + */ @Test - public void testFindPetsByStatus() throws Exception { - Pet pet = createRandomPet(); - pet.setName("programmer"); - pet.setStatus(Pet.StatusEnum.PENDING); - - api.updatePet(pet); - - List pets = api.findPetsByStatus(Arrays.asList("pending")); - assertNotNull(pets); - - boolean found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } - - assertTrue(found); - - api.deletePet(pet.getId(), null); - } - - @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("friendly")); - assertNotNull(pets); - - boolean found = false; - for (Pet fetched : pets) { - if (fetched.getId().equals(pet.getId())) { - found = true; - break; - } - } - assertTrue(found); - - api.deletePet(pet.getId(), null); - } - - @Test - public void testUpdatePetWithForm() throws Exception { - Pet pet = createRandomPet(); - pet.setName("frank"); - api.addPet(pet); - - Pet fetched = api.getPetById(pet.getId()); - - api.updatePetWithForm(fetched.getId(), "furt", null); - Pet updated = api.getPetById(fetched.getId()); - - assertEquals(updated.getName(), "furt"); - } - + 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 testDeletePet() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet); - - Pet fetched = api.getPetById(pet.getId()); - api.deletePet(fetched.getId(), null); - - try { - fetched = api.getPetById(fetched.getId()); - fail("expected an error"); - } catch (ApiException e) { - assertEquals(404, e.getCode()); - } - } - - @Test - public void testUploadFile() throws Exception { - Pet pet = createRandomPet(); - api.addPet(pet); - - File file = new File("hello.txt"); - BufferedWriter writer = new BufferedWriter(new FileWriter(file)); - writer.write("Hello world!"); - writer.close(); - - api.uploadFile(pet.getId(), "a test file", new File(file.getAbsolutePath())); - } - - @Test - public void testEqualsAndHashCode() { - Pet pet1 = new Pet(); - Pet pet2 = new Pet(); - assertTrue(pet1.equals(pet2)); - assertTrue(pet2.equals(pet1)); - assertTrue(pet1.hashCode() == pet2.hashCode()); - assertTrue(pet1.equals(pet1)); - assertTrue(pet1.hashCode() == pet1.hashCode()); - - pet2.setName("really-happy"); - pet2.setPhotoUrls(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")); - assertFalse(pet1.equals(pet2)); - assertFalse(pet2.equals(pet1)); - assertFalse(pet1.hashCode() == (pet2.hashCode())); - assertTrue(pet2.equals(pet2)); - assertTrue(pet2.hashCode() == pet2.hashCode()); - - pet1.setName("really-happy"); - pet1.setPhotoUrls(Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2")); - assertTrue(pet1.equals(pet2)); - assertTrue(pet2.equals(pet1)); - assertTrue(pet1.hashCode() == pet2.hashCode()); - assertTrue(pet1.equals(pet1)); - assertTrue(pet1.hashCode() == pet1.hashCode()); - } - - private Pet createRandomPet() { - Pet pet = new Pet(); - pet.setId(TestUtils.nextId()); - pet.setName("gorilla"); - - Category category = new Category(); - category.setName("really-happy"); - - pet.setCategory(category); - pet.setStatus(Pet.StatusEnum.AVAILABLE); - List photos = Arrays.asList("http://foo.bar.com/1", "http://foo.bar.com/2"); - pet.setPhotoUrls(photos); - - return pet; - } - - private String serializeJson(Object o, ApiClient apiClient) { - return apiClient.getJSON().serialize(o); - } + public void uploadFileTest() throws ApiException { + + Integer petId = null; + + Object body = null; + + ModelApiResponse response = api.uploadFile(petId, body); - private T deserializeJson(String json, Type type, ApiClient apiClient) { - return (T) apiClient.getJSON().deserialize(json, type); + // TODO: test validations } + } diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/StoreApiTest.java index c4c64fdda79..c6d9b89f0bd 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -1,99 +1,108 @@ +/* + * Swagger Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + package io.swagger.client.api; -import io.swagger.TestUtils; import io.swagger.client.ApiException; +import io.swagger.client.model.Order; -import 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 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 { - StoreApi api = null; - - @Before - public void setup() { - api = new StoreApi(); - // setup authentication - ApiKeyAuth apiKeyAuth = (ApiKeyAuth) api.getApiClient().getAuthentication("api_key"); - apiKeyAuth.setApiKey("special-key"); - } - - @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); + public void deleteOrderTest() throws ApiException { + + 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); - // NOTE: Gson parses integer value to double. - assertTrue(firstEntry.getValue() instanceof Double); + // 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/okhttp-gson/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/UserApiTest.java index b47a146d737..175f42fca9c 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/UserApiTest.java @@ -1,87 +1,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.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/okhttp-gson/src/test/java/io/swagger/client/auth/ApiKeyAuthTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/auth/ApiKeyAuthTest.java deleted file mode 100644 index 3715e9724e6..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/auth/ApiKeyAuthTest.java +++ /dev/null @@ -1,76 +0,0 @@ -package io.swagger.client.auth; - -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import io.swagger.client.Pair; -import org.junit.*; -import static org.junit.Assert.*; - - -public class ApiKeyAuthTest { - @Test - public void testApplyToParamsInQuery() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); - auth.setApiKey("my-api-key"); - auth.applyToParams(queryParams, headerParams); - - assertEquals(1, queryParams.size()); - for (Pair queryParam : queryParams) { - assertEquals("my-api-key", queryParam.getValue()); - } - - // no changes to header parameters - assertEquals(0, headerParams.size()); - } - - @Test - public void testApplyToParamsInQueryWithNullValue() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("query", "api_key"); - auth.setApiKey(null); - auth.applyToParams(queryParams, headerParams); - - // no changes to parameters - assertEquals(0, queryParams.size()); - assertEquals(0, headerParams.size()); - } - - @Test - public void testApplyToParamsInHeaderWithPrefix() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); - auth.setApiKey("my-api-token"); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams); - - // no changes to query parameters - assertEquals(0, queryParams.size()); - assertEquals(1, headerParams.size()); - assertEquals("Token my-api-token", headerParams.get("X-API-TOKEN")); - } - - @Test - public void testApplyToParamsInHeaderWithNullValue() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - - ApiKeyAuth auth = new ApiKeyAuth("header", "X-API-TOKEN"); - auth.setApiKey(null); - auth.setApiKeyPrefix("Token"); - auth.applyToParams(queryParams, headerParams); - - // no changes to parameters - assertEquals(0, queryParams.size()); - assertEquals(0, headerParams.size()); - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/auth/HttpBasicAuthTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/auth/HttpBasicAuthTest.java deleted file mode 100644 index ddee04f57fc..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/auth/HttpBasicAuthTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package io.swagger.client.auth; - -import java.util.HashMap; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; - -import io.swagger.client.Pair; -import org.junit.*; -import static org.junit.Assert.*; - - -public class HttpBasicAuthTest { - HttpBasicAuth auth = null; - - @Before - public void setup() { - auth = new HttpBasicAuth(); - } - - @Test - public void testApplyToParams() { - List queryParams = new ArrayList(); - Map headerParams = new HashMap(); - - auth.setUsername("my-username"); - auth.setPassword("my-password"); - auth.applyToParams(queryParams, headerParams); - - // no changes to query parameters - assertEquals(0, queryParams.size()); - assertEquals(1, headerParams.size()); - // the string below is base64-encoded result of "my-username:my-password" with the "Basic " prefix - String expected = "Basic bXktdXNlcm5hbWU6bXktcGFzc3dvcmQ="; - assertEquals(expected, headerParams.get("Authorization")); - - // null username should be treated as empty string - auth.setUsername(null); - auth.applyToParams(queryParams, headerParams); - // the string below is base64-encoded result of ":my-password" with the "Basic " prefix - expected = "Basic Om15LXBhc3N3b3Jk"; - assertEquals(expected, headerParams.get("Authorization")); - - // null password should be treated as empty string - auth.setUsername("my-username"); - auth.setPassword(null); - auth.applyToParams(queryParams, headerParams); - // the string below is base64-encoded result of "my-username:" with the "Basic " prefix - expected = "Basic bXktdXNlcm5hbWU6"; - assertEquals(expected, headerParams.get("Authorization")); - - // null username and password should be ignored - queryParams = new ArrayList(); - headerParams = new HashMap(); - auth.setUsername(null); - auth.setPassword(null); - auth.applyToParams(queryParams, headerParams); - // no changes to parameters - assertEquals(0, queryParams.size()); - assertEquals(0, headerParams.size()); - } -} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/model/EnumValueTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/model/EnumValueTest.java deleted file mode 100644 index a74a4a31b66..00000000000 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/model/EnumValueTest.java +++ /dev/null @@ -1,56 +0,0 @@ -package io.swagger.client.model; - -import org.junit.Test; - -import com.google.gson.Gson; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -public class EnumValueTest { - - @Test - public void testEnumClass() { - assertEquals(EnumClass._ABC.toString(), "_abc"); - assertEquals(EnumClass._EFG.toString(), "-efg"); - assertEquals(EnumClass._XYZ_.toString(), "(xyz)"); - } - - @Test - public void testEnumTest() { - // test enum value - EnumTest enumTest = new EnumTest(); - enumTest.setEnumString(EnumTest.EnumStringEnum.LOWER); - enumTest.setEnumInteger(EnumTest.EnumIntegerEnum.NUMBER_1); - enumTest.setEnumNumber(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1); - - assertEquals(EnumTest.EnumStringEnum.UPPER.toString(), "UPPER"); - assertEquals(EnumTest.EnumStringEnum.UPPER.getValue(), "UPPER"); - assertEquals(EnumTest.EnumStringEnum.LOWER.toString(), "lower"); - assertEquals(EnumTest.EnumStringEnum.LOWER.getValue(), "lower"); - - assertEquals(EnumTest.EnumIntegerEnum.NUMBER_1.toString(), "1"); - assertTrue(EnumTest.EnumIntegerEnum.NUMBER_1.getValue() == 1); - assertEquals(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.toString(), "-1"); - assertTrue(EnumTest.EnumIntegerEnum.NUMBER_MINUS_1.getValue() == -1); - - assertEquals(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.toString(), "1.1"); - assertTrue(EnumTest.EnumNumberEnum.NUMBER_1_DOT_1.getValue() == 1.1); - assertEquals(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.toString(), "-1.2"); - assertTrue(EnumTest.EnumNumberEnum.NUMBER_MINUS_1_DOT_2.getValue() == -1.2); - - // test serialization - Gson gson = new Gson(); - String json = gson.toJson(enumTest); - assertEquals(json, "{\"enum_string\":\"lower\",\"enum_integer\":1,\"enum_number\":1.1}"); - - // test deserialization - EnumTest fromString = gson.fromJson(json, EnumTest.class); - assertEquals(fromString.getEnumString().toString(), "lower"); - assertEquals(fromString.getEnumString().getValue(), "lower"); - assertEquals(fromString.getEnumInteger().toString(), "1"); - assertTrue(fromString.getEnumInteger().getValue() == 1); - assertEquals(fromString.getEnumNumber().toString(), "1.1"); - assertTrue(fromString.getEnumNumber().getValue() == 1.1); - } -}