From d4543a99e38adfb6e9b0bedf2784b24021e19ef7 Mon Sep 17 00:00:00 2001 From: Adrien CABARBAYE Date: Thu, 22 Feb 2018 13:45:19 +0000 Subject: [PATCH] [Java][retrofit2] Fix for Issue #7446 (#7659) * [Java][retrofit2] Fix for issue #7446: file upload sets filename as baseName instead of a dynamic filename. The solution is to use okhttp3.MultipartBody.Part instead of RequestBody in formParams template. * Changes corresponding to review comments * Petstore Samples * Fixed tests --- .../Java/libraries/retrofit2/api.mustache | 1 + .../libraries/retrofit2/formParams.mustache | 2 +- .../java/retrofit2-play24/docs/UserApi.md | 4 +- .../java/io/swagger/client/api/PetApi.java | 2 +- .../java/io/swagger/client/api/UserApi.java | 2 +- .../retrofit2-play25/.swagger-codegen/VERSION | 2 +- .../java/retrofit2-play25/build.gradle | 2 +- .../petstore/java/retrofit2-play25/build.sbt | 2 +- .../java/retrofit2-play25/docs/FakeApi.md | 28 +++++------ .../java/retrofit2-play25/docs/PetApi.md | 28 +++++------ .../java/retrofit2-play25/docs/StoreApi.md | 7 ++- .../java/retrofit2-play25/docs/UserApi.md | 46 ++++++++----------- .../petstore/java/retrofit2-play25/pom.xml | 1 - .../gen/io/swagger/client/BuildConfig.java | 8 ---- .../main/gen/io/swagger/client/Manifest.java | 7 --- .../src/main/gen/io/swagger/client/R.java | 7 --- .../java/io/swagger/client/api/PetApi.java | 2 +- .../java/io/swagger/client/api/UserApi.java | 2 +- .../model/AdditionalPropertiesClass.java | 1 + .../java/io/swagger/client/model/Animal.java | 1 + .../io/swagger/client/model/AnimalFarm.java | 1 + .../model/ArrayOfArrayOfNumberOnly.java | 1 + .../client/model/ArrayOfNumberOnly.java | 1 + .../io/swagger/client/model/ArrayTest.java | 1 + .../swagger/client/model/Capitalization.java | 1 + .../java/io/swagger/client/model/Cat.java | 1 + .../io/swagger/client/model/Category.java | 1 + .../io/swagger/client/model/ClassModel.java | 1 + .../java/io/swagger/client/model/Client.java | 1 + .../java/io/swagger/client/model/Dog.java | 1 + .../io/swagger/client/model/EnumArrays.java | 1 + .../io/swagger/client/model/EnumClass.java | 1 + .../io/swagger/client/model/EnumTest.java | 1 + .../io/swagger/client/model/FormatTest.java | 7 +-- .../swagger/client/model/HasOnlyReadOnly.java | 1 + .../java/io/swagger/client/model/MapTest.java | 1 + ...ropertiesAndAdditionalPropertiesClass.java | 1 + .../client/model/Model200Response.java | 1 + .../client/model/ModelApiResponse.java | 1 + .../io/swagger/client/model/ModelReturn.java | 1 + .../java/io/swagger/client/model/Name.java | 1 + .../io/swagger/client/model/NumberOnly.java | 1 + .../java/io/swagger/client/model/Order.java | 1 + .../swagger/client/model/OuterComposite.java | 1 + .../io/swagger/client/model/OuterEnum.java | 1 + .../java/io/swagger/client/model/Pet.java | 1 + .../swagger/client/model/ReadOnlyFirst.java | 1 + .../client/model/SpecialModelName.java | 1 + .../java/io/swagger/client/model/Tag.java | 1 + .../java/io/swagger/client/model/User.java | 1 + .../petstore/java/retrofit2/docs/UserApi.md | 4 +- .../io/swagger/client/api/AnotherFakeApi.java | 1 + .../java/io/swagger/client/api/FakeApi.java | 1 + .../client/api/FakeClassnameTags123Api.java | 1 + .../java/io/swagger/client/api/PetApi.java | 3 +- .../java/io/swagger/client/api/StoreApi.java | 1 + .../java/io/swagger/client/api/UserApi.java | 3 +- .../io/swagger/client/api/PetApiTest.java | 7 +-- .../petstore/java/retrofit2rx/docs/UserApi.md | 4 +- .../io/swagger/client/api/AnotherFakeApi.java | 1 + .../java/io/swagger/client/api/FakeApi.java | 1 + .../client/api/FakeClassnameTags123Api.java | 1 + .../java/io/swagger/client/api/PetApi.java | 3 +- .../java/io/swagger/client/api/StoreApi.java | 1 + .../java/io/swagger/client/api/UserApi.java | 3 +- .../io/swagger/client/api/PetApiTest.java | 5 +- .../java/retrofit2rx2/docs/UserApi.md | 4 +- .../io/swagger/client/api/AnotherFakeApi.java | 1 + .../java/io/swagger/client/api/FakeApi.java | 1 + .../client/api/FakeClassnameTags123Api.java | 1 + .../java/io/swagger/client/api/PetApi.java | 3 +- .../java/io/swagger/client/api/StoreApi.java | 1 + .../java/io/swagger/client/api/UserApi.java | 3 +- 73 files changed, 130 insertions(+), 115 deletions(-) delete mode 100644 samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/BuildConfig.java delete mode 100644 samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/Manifest.java delete mode 100644 samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/R.java diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/api.mustache index 0258afda049..f6eb4c2dd07 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/api.mustache @@ -20,6 +20,7 @@ import retrofit2.http.*; import okhttp3.RequestBody; import okhttp3.ResponseBody; +import okhttp3.MultipartBody; {{#imports}}import {{import}}; {{/imports}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/formParams.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/formParams.mustache index 06c13e9ea33..b3f54cc4ddb 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{#notFile}}{{#isMultipart}}@retrofit2.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit2.http.Field{{/isMultipart}}("{{baseName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}{{#isMultipart}}@retrofit2.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit2.http.Field{{/isMultipart}}{{#usePlayWS}} okhttp3.MultipartBody.Part {{/usePlayWS}}{{^usePlayWS}}("{{baseName}}\"; filename=\"{{baseName}}") RequestBody {{/usePlayWS}}{{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{#notFile}}{{#isMultipart}}@retrofit2.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit2.http.Field{{/isMultipart}}("{{baseName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}}{{#isMultipart}}@retrofit2.http.Part{{/isMultipart}}{{^isMultipart}}@retrofit2.http.Field{{/isMultipart}} MultipartBody.Part {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play24/docs/UserApi.md b/samples/client/petstore/java/retrofit2-play24/docs/UserApi.md index 95208371279..47754bafed3 100644 --- a/samples/client/petstore/java/retrofit2-play24/docs/UserApi.md +++ b/samples/client/petstore/java/retrofit2-play24/docs/UserApi.md @@ -206,7 +206,7 @@ Get user by user name UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. +String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. try { User result = apiInstance.getUserByName(username); System.out.println(result); @@ -220,7 +220,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | ### Return type diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/PetApi.java index 0102aea1c13..cee6252af7a 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/PetApi.java @@ -120,7 +120,7 @@ F.Promise> updatePetWithForm( @retrofit2.http.Multipart @POST("pet/{petId}/uploadImage") F.Promise> uploadFile( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part okhttp3.MultipartBody.Part file + @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part MultipartBody.Part file ); } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/UserApi.java index 9b553463002..2a9cc3b9909 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/api/UserApi.java @@ -67,7 +67,7 @@ F.Promise> deleteUser( /** * Get user by user name * - * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return Call<User> */ @GET("user/{username}") diff --git a/samples/client/petstore/java/retrofit2-play25/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit2-play25/.swagger-codegen/VERSION index 50794f17f1a..855ff9501eb 100644 --- a/samples/client/petstore/java/retrofit2-play25/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/retrofit2-play25/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +2.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play25/build.gradle b/samples/client/petstore/java/retrofit2-play25/build.gradle index a0ac15f6e7f..01f25ad289c 100644 --- a/samples/client/petstore/java/retrofit2-play25/build.gradle +++ b/samples/client/petstore/java/retrofit2-play25/build.gradle @@ -98,7 +98,7 @@ ext { retrofit_version = "2.3.0" jackson_version = "2.7.8" play_version = "2.5.14" - swagger_annotations_version = "1.5.15" + swagger_annotations_version = "1.5.17" junit_version = "4.12" threetenbp_version = "1.3.5" json_fire_version = "1.8.0" diff --git a/samples/client/petstore/java/retrofit2-play25/build.sbt b/samples/client/petstore/java/retrofit2-play25/build.sbt index 1988e88ce9a..addc43ee197 100644 --- a/samples/client/petstore/java/retrofit2-play25/build.sbt +++ b/samples/client/petstore/java/retrofit2-play25/build.sbt @@ -16,7 +16,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-annotations" % "2.7.8" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.7.8" % "compile", "com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile", - "io.swagger" % "swagger-annotations" % "1.5.15" % "compile", + "io.swagger" % "swagger-annotations" % "1.5.17" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", "org.threeten" % "threetenbp" % "1.3.5" % "compile", "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", diff --git a/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md b/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md index 3e052dea273..9526fadf552 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/FakeApi.md @@ -242,7 +242,7 @@ No authorization required # **testEndpointParameters** -> Void testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) +> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -280,8 +280,7 @@ OffsetDateTime dateTime = new OffsetDateTime(); // OffsetDateTime | None String password = "password_example"; // String | None String paramCallback = "paramCallback_example"; // String | None try { - Void result = apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); - System.out.println(result); + apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEndpointParameters"); e.printStackTrace(); @@ -309,7 +308,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +null (empty response body) ### Authorization @@ -322,7 +321,7 @@ Name | Type | Description | Notes # **testEnumParameters** -> Void testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) +> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) To test enum parameters @@ -345,8 +344,7 @@ 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) try { - Void result = apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); - System.out.println(result); + apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testEnumParameters"); e.printStackTrace(); @@ -368,7 +366,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +null (empty response body) ### Authorization @@ -381,7 +379,7 @@ No authorization required # **testInlineAdditionalProperties** -> Void testInlineAdditionalProperties(param) +> testInlineAdditionalProperties(param) test inline additionalProperties @@ -397,8 +395,7 @@ test inline additionalProperties FakeApi apiInstance = new FakeApi(); Object param = null; // Object | request body try { - Void result = apiInstance.testInlineAdditionalProperties(param); - System.out.println(result); + apiInstance.testInlineAdditionalProperties(param); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); e.printStackTrace(); @@ -413,7 +410,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +null (empty response body) ### Authorization @@ -426,7 +423,7 @@ No authorization required # **testJsonFormData** -> Void testJsonFormData(param, param2) +> testJsonFormData(param, param2) test json serialization of form data @@ -443,8 +440,7 @@ FakeApi apiInstance = new FakeApi(); String param = "param_example"; // String | field1 String param2 = "param2_example"; // String | field2 try { - Void result = apiInstance.testJsonFormData(param, param2); - System.out.println(result); + apiInstance.testJsonFormData(param, param2); } catch (ApiException e) { System.err.println("Exception when calling FakeApi#testJsonFormData"); e.printStackTrace(); @@ -460,7 +456,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +null (empty response body) ### Authorization diff --git a/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md b/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md index ea3c05ad412..0bfc5532bbf 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/PetApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **addPet** -> Void addPet(body) +> addPet(body) Add a new pet to the store @@ -40,8 +40,7 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { - Void result = apiInstance.addPet(body); - System.out.println(result); + apiInstance.addPet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -56,7 +55,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +null (empty response body) ### Authorization @@ -69,7 +68,7 @@ Name | Type | Description | Notes # **deletePet** -> Void deletePet(petId, apiKey) +> deletePet(petId, apiKey) Deletes a pet @@ -94,8 +93,7 @@ PetApi apiInstance = new PetApi(); Long petId = 789L; // Long | Pet id to delete String apiKey = "apiKey_example"; // String | try { - Void result = apiInstance.deletePet(petId, apiKey); - System.out.println(result); + apiInstance.deletePet(petId, apiKey); } catch (ApiException e) { System.err.println("Exception when calling PetApi#deletePet"); e.printStackTrace(); @@ -111,7 +109,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +null (empty response body) ### Authorization @@ -285,7 +283,7 @@ Name | Type | Description | Notes # **updatePet** -> Void updatePet(body) +> updatePet(body) Update an existing pet @@ -309,8 +307,7 @@ petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); PetApi apiInstance = new PetApi(); Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { - Void result = apiInstance.updatePet(body); - System.out.println(result); + apiInstance.updatePet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -325,7 +322,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +null (empty response body) ### Authorization @@ -338,7 +335,7 @@ Name | Type | Description | Notes # **updatePetWithForm** -> Void updatePetWithForm(petId, name, status) +> updatePetWithForm(petId, name, status) Updates a pet in the store with form data @@ -364,8 +361,7 @@ Long petId = 789L; // Long | ID of pet that needs to be updated String name = "name_example"; // String | Updated name of the pet String status = "status_example"; // String | Updated status of the pet try { - Void result = apiInstance.updatePetWithForm(petId, name, status); - System.out.println(result); + apiInstance.updatePetWithForm(petId, name, status); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePetWithForm"); e.printStackTrace(); @@ -382,7 +378,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +null (empty response body) ### Authorization diff --git a/samples/client/petstore/java/retrofit2-play25/docs/StoreApi.md b/samples/client/petstore/java/retrofit2-play25/docs/StoreApi.md index 134f0c36578..77314313236 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/StoreApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/StoreApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description # **deleteOrder** -> Void deleteOrder(orderId) +> deleteOrder(orderId) Delete purchase order by ID @@ -28,8 +28,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or StoreApi apiInstance = new StoreApi(); String orderId = "orderId_example"; // String | ID of the order that needs to be deleted try { - Void result = apiInstance.deleteOrder(orderId); - System.out.println(result); + apiInstance.deleteOrder(orderId); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#deleteOrder"); e.printStackTrace(); @@ -44,7 +43,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +null (empty response body) ### Authorization diff --git a/samples/client/petstore/java/retrofit2-play25/docs/UserApi.md b/samples/client/petstore/java/retrofit2-play25/docs/UserApi.md index 40096ec05bc..47754bafed3 100644 --- a/samples/client/petstore/java/retrofit2-play25/docs/UserApi.md +++ b/samples/client/petstore/java/retrofit2-play25/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> Void createUser(body) +> createUser(body) Create user @@ -32,8 +32,7 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); User body = new User(); // User | Created user object try { - Void result = apiInstance.createUser(body); - System.out.println(result); + apiInstance.createUser(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -48,7 +47,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +null (empty response body) ### Authorization @@ -61,7 +60,7 @@ No authorization required # **createUsersWithArrayInput** -> Void createUsersWithArrayInput(body) +> createUsersWithArrayInput(body) Creates list of users with given input array @@ -77,8 +76,7 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); List body = Arrays.asList(new User()); // List | List of user object try { - Void result = apiInstance.createUsersWithArrayInput(body); - System.out.println(result); + apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -93,7 +91,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +null (empty response body) ### Authorization @@ -106,7 +104,7 @@ No authorization required # **createUsersWithListInput** -> Void createUsersWithListInput(body) +> createUsersWithListInput(body) Creates list of users with given input array @@ -122,8 +120,7 @@ Creates list of users with given input array UserApi apiInstance = new UserApi(); List body = Arrays.asList(new User()); // List | List of user object try { - Void result = apiInstance.createUsersWithListInput(body); - System.out.println(result); + apiInstance.createUsersWithListInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -138,7 +135,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +null (empty response body) ### Authorization @@ -151,7 +148,7 @@ No authorization required # **deleteUser** -> Void deleteUser(username) +> deleteUser(username) Delete user @@ -167,8 +164,7 @@ This can only be done by the logged in user. UserApi apiInstance = new UserApi(); String username = "username_example"; // String | The name that needs to be deleted try { - Void result = apiInstance.deleteUser(username); - System.out.println(result); + apiInstance.deleteUser(username); } catch (ApiException e) { System.err.println("Exception when calling UserApi#deleteUser"); e.printStackTrace(); @@ -183,7 +179,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +null (empty response body) ### Authorization @@ -210,7 +206,7 @@ Get user by user name UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. +String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. try { User result = apiInstance.getUserByName(username); System.out.println(result); @@ -224,7 +220,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | ### Return type @@ -288,7 +284,7 @@ No authorization required # **logoutUser** -> Void logoutUser() +> logoutUser() Logs out current logged in user session @@ -303,8 +299,7 @@ Logs out current logged in user session UserApi apiInstance = new UserApi(); try { - Void result = apiInstance.logoutUser(); - System.out.println(result); + apiInstance.logoutUser(); } catch (ApiException e) { System.err.println("Exception when calling UserApi#logoutUser"); e.printStackTrace(); @@ -316,7 +311,7 @@ This endpoint does not need any parameter. ### Return type -[**Void**](.md) +null (empty response body) ### Authorization @@ -329,7 +324,7 @@ No authorization required # **updateUser** -> Void updateUser(username, body) +> updateUser(username, body) Updated user @@ -346,8 +341,7 @@ UserApi apiInstance = new UserApi(); String username = "username_example"; // String | name that need to be deleted User body = new User(); // User | Updated user object try { - Void result = apiInstance.updateUser(username, body); - System.out.println(result); + apiInstance.updateUser(username, body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -363,7 +357,7 @@ Name | Type | Description | Notes ### Return type -[**Void**](.md) +null (empty response body) ### Authorization diff --git a/samples/client/petstore/java/retrofit2-play25/pom.xml b/samples/client/petstore/java/retrofit2-play25/pom.xml index b516139b225..0b877f37cd8 100644 --- a/samples/client/petstore/java/retrofit2-play25/pom.xml +++ b/samples/client/petstore/java/retrofit2-play25/pom.xml @@ -208,7 +208,6 @@ converter-scalars ${retrofit-version} - org.apache.oltu.oauth2 org.apache.oltu.oauth2.client diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/BuildConfig.java b/samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/BuildConfig.java deleted file mode 100644 index 720765940d3..00000000000 --- a/samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/BuildConfig.java +++ /dev/null @@ -1,8 +0,0 @@ -/*___Generated_by_IDEA___*/ - -package io.swagger.client; - -/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */ -public final class BuildConfig { - public final static boolean DEBUG = Boolean.parseBoolean(null); -} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/Manifest.java b/samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/Manifest.java deleted file mode 100644 index 41e0523a208..00000000000 --- a/samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/Manifest.java +++ /dev/null @@ -1,7 +0,0 @@ -/*___Generated_by_IDEA___*/ - -package io.swagger.client; - -/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */ -public final class Manifest { -} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/R.java b/samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/R.java deleted file mode 100644 index cd0683364d5..00000000000 --- a/samples/client/petstore/java/retrofit2-play25/src/main/gen/io/swagger/client/R.java +++ /dev/null @@ -1,7 +0,0 @@ -/*___Generated_by_IDEA___*/ - -package io.swagger.client; - -/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */ -public final class R { -} \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/PetApi.java index 45256eb3c8d..eabf6f7f2ea 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/PetApi.java @@ -120,7 +120,7 @@ CompletionStage> updatePetWithForm( @retrofit2.http.Multipart @POST("pet/{petId}/uploadImage") CompletionStage> uploadFile( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part okhttp3.MultipartBody.Part file + @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part MultipartBody.Part file ); } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/UserApi.java index e5792d9ec00..bd9052c78ee 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/api/UserApi.java @@ -67,7 +67,7 @@ CompletionStage> deleteUser( /** * Get user by user name * - * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return Call<User> */ @GET("user/{username}") diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java index f03052a0c41..5a1c7691c55 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Animal.java index 023cb11b7eb..e58ba549b29 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Animal.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Animal.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/AnimalFarm.java index fc38d86a0aa..db24be97f8e 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/AnimalFarm.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/AnimalFarm.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import io.swagger.client.model.Animal; import java.util.ArrayList; import java.util.List; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java index a5f6292b7b4..9e8e505b0a8 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java index 443501f0598..5bd6a61c518 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayTest.java index 4934689e7dc..9c14e88fd10 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ArrayTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Capitalization.java index e7a0b0ac935..c61fb2baf8a 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Capitalization.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Capitalization.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Cat.java index 7c513d6d6dd..e72ef14ea4b 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Cat.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Cat.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Category.java index bf8840d5fcf..7ea2c9e2665 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Category.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Category.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ClassModel.java index f3d9160e3db..4a97bef0b29 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ClassModel.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ClassModel.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Client.java index a09f13e7a2c..aa7645f3346 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Client.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Client.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Dog.java index 3835e2aca37..91395070b38 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Dog.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Dog.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumArrays.java index f3cff0ea172..3e83a66d712 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumArrays.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumClass.java index f3211289d46..3a95df2b49e 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumTest.java index 779c3abcc1b..59a060b266c 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/FormatTest.java index adf0a66ceeb..0b8cad1e86e 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/FormatTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/FormatTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; @@ -339,8 +340,8 @@ public boolean equals(java.lang.Object o) { Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && Objects.equals(this.string, formatTest.string) && - Objects.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && + Arrays.equals(this._byte, formatTest._byte) && + Arrays.equals(this.binary, formatTest.binary) && Objects.equals(this.date, formatTest.date) && Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && @@ -349,7 +350,7 @@ public boolean equals(java.lang.Object o) { @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); + return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), Arrays.hashCode(binary), date, dateTime, uuid, password); } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java index 5f86fb84a96..7b51af838f2 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MapTest.java index 1a15255161d..21f85f08021 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MapTest.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index a1865dc6e66..0a2b19f707d 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Model200Response.java index 89ed29eca5d..5f9a94de22f 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Model200Response.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Model200Response.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelApiResponse.java index acfb194d9d7..5663615e1e4 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelApiResponse.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelReturn.java index d372354eb7e..8a4bfc1cfe9 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelReturn.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelReturn.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Name.java index c09048cce39..12361b87e91 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Name.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Name.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/NumberOnly.java index 91ab4497dc2..5f8402f9295 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/NumberOnly.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/NumberOnly.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Order.java index 35d1f3e67e1..985fecd2590 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Order.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterComposite.java index 5b0e216eaa2..e836faf7e28 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterComposite.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterComposite.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterEnum.java index 778c8dca14a..2f7b2171652 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterEnum.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import javax.validation.constraints.*; import javax.validation.Valid; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Pet.java index 653a9765a66..db153aadaa6 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Pet.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ReadOnlyFirst.java index dc2373a365d..c1e4436bbe5 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/SpecialModelName.java index f01a06d4c78..9b2fa79d42f 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/SpecialModelName.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Tag.java index 71ff1bfcf67..6d3fad7d091 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Tag.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Tag.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/User.java index 82c6be534ec..1683fcce7f3 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/User.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/User.java @@ -14,6 +14,7 @@ package io.swagger.client.model; import java.util.Objects; +import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; diff --git a/samples/client/petstore/java/retrofit2/docs/UserApi.md b/samples/client/petstore/java/retrofit2/docs/UserApi.md index 95208371279..47754bafed3 100644 --- a/samples/client/petstore/java/retrofit2/docs/UserApi.md +++ b/samples/client/petstore/java/retrofit2/docs/UserApi.md @@ -206,7 +206,7 @@ Get user by user name UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. +String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. try { User result = apiInstance.getUserByName(username); System.out.println(result); @@ -220,7 +220,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | ### Return type diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/AnotherFakeApi.java index dd5886b3bdd..086d3d6b652 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -7,6 +7,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import io.swagger.client.model.Client; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java index 8842354c81f..06810d19a1f 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeApi.java @@ -7,6 +7,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import java.math.BigDecimal; import io.swagger.client.model.Client; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index c31c31c9233..022fd8118b3 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -7,6 +7,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import io.swagger.client.model.Client; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/PetApi.java index 768a27f23aa..a3e4edbc79d 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/PetApi.java @@ -7,6 +7,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import java.io.File; import io.swagger.client.model.ModelApiResponse; @@ -118,7 +119,7 @@ Call updatePetWithForm( @retrofit2.http.Multipart @POST("pet/{petId}/uploadImage") Call uploadFile( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part("file\"; filename=\"file") RequestBody file + @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part MultipartBody.Part file ); } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java index 99367e1a0c3..ef1a16963b1 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/StoreApi.java @@ -7,6 +7,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import io.swagger.client.model.Order; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/UserApi.java index ab2074c4e80..e9b60ea44ed 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/api/UserApi.java @@ -7,6 +7,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import io.swagger.client.model.User; @@ -63,7 +64,7 @@ Call deleteUser( /** * Get user by user name * - * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return Call<User> */ @GET("user/{username}") diff --git a/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/PetApiTest.java index bbaa0000f44..25f807c8cae 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/PetApiTest.java @@ -19,6 +19,7 @@ import okhttp3.MediaType; import okhttp3.RequestBody; +import okhttp3.MultipartBody; import static org.junit.Assert.*; @@ -139,9 +140,9 @@ public void testUploadFile() throws Exception { File file = new File("hello.txt"); BufferedWriter writer = new BufferedWriter(new FileWriter(file)); writer.write("Hello world!"); - writer.close(); - - api.uploadFile(pet.getId(), null, RequestBody.create(MediaType.parse("text/plain"), file)).execute(); + writer.close(); + final RequestBody body = RequestBody.create(MediaType.parse("text/plain"), file); + api.uploadFile(pet.getId(), null, MultipartBody.Part.createFormData("datafile", file.getName(), body)).execute(); } @Test diff --git a/samples/client/petstore/java/retrofit2rx/docs/UserApi.md b/samples/client/petstore/java/retrofit2rx/docs/UserApi.md index 95208371279..47754bafed3 100644 --- a/samples/client/petstore/java/retrofit2rx/docs/UserApi.md +++ b/samples/client/petstore/java/retrofit2rx/docs/UserApi.md @@ -206,7 +206,7 @@ Get user by user name UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. +String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. try { User result = apiInstance.getUserByName(username); System.out.println(result); @@ -220,7 +220,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | ### Return type diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/AnotherFakeApi.java index f3a744e9c88..94301cef446 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -7,6 +7,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import io.swagger.client.model.Client; diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java index 25c403fceeb..0defac625ef 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeApi.java @@ -7,6 +7,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import java.math.BigDecimal; import io.swagger.client.model.Client; diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index 41a9fc215ca..884b9b6f6d7 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -7,6 +7,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import io.swagger.client.model.Client; diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java index b8325a9db87..403ccb07b84 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/PetApi.java @@ -7,6 +7,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import java.io.File; import io.swagger.client.model.ModelApiResponse; @@ -118,7 +119,7 @@ Observable updatePetWithForm( @retrofit2.http.Multipart @POST("pet/{petId}/uploadImage") Observable uploadFile( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part("file\"; filename=\"file") RequestBody file + @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part MultipartBody.Part file ); } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/StoreApi.java index e3b6637db03..1b31e032989 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/StoreApi.java @@ -7,6 +7,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import io.swagger.client.model.Order; diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/UserApi.java index 79d46595bf5..1c042954cd5 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/api/UserApi.java @@ -7,6 +7,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import io.swagger.client.model.User; @@ -63,7 +64,7 @@ Observable deleteUser( /** * Get user by user name * - * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return Observable<User> */ @GET("user/{username}") diff --git a/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/PetApiTest.java index 8fa02bed636..330504b6bd8 100644 --- a/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/PetApiTest.java @@ -14,6 +14,7 @@ import org.junit.*; import okhttp3.MediaType; +import okhttp3.MultipartBody; import okhttp3.RequestBody; import static org.junit.Assert.*; @@ -200,8 +201,8 @@ public void testUploadFile() throws Exception { Pet pet = createRandomPet(); api.addPet(pet).subscribe(SkeletonSubscriber.failTestOnError()); - RequestBody body = RequestBody.create(MediaType.parse("text/plain"), file); - api.uploadFile(pet.getId(), "a test file", body).subscribe(new SkeletonSubscriber() { + final RequestBody body = RequestBody.create(MediaType.parse("text/plain"), file); + api.uploadFile(pet.getId(), "a test file", MultipartBody.Part.createFormData("datafile", file.getName(), body)).subscribe(new SkeletonSubscriber() { @Override public void onError(Throwable e) { // this also yields a 400 for other tests, so I guess it's okay... diff --git a/samples/client/petstore/java/retrofit2rx2/docs/UserApi.md b/samples/client/petstore/java/retrofit2rx2/docs/UserApi.md index 95208371279..47754bafed3 100644 --- a/samples/client/petstore/java/retrofit2rx2/docs/UserApi.md +++ b/samples/client/petstore/java/retrofit2rx2/docs/UserApi.md @@ -206,7 +206,7 @@ Get user by user name UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. +String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. try { User result = apiInstance.getUserByName(username); System.out.println(result); @@ -220,7 +220,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | + **username** | **String**| The name that needs to be fetched. Use user1 for testing. | ### Return type diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/AnotherFakeApi.java index f9bc971c63c..4b14191983a 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/AnotherFakeApi.java @@ -8,6 +8,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import io.swagger.client.model.Client; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/FakeApi.java index 6717e2fb332..7c1fd4ae0d5 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/FakeApi.java @@ -8,6 +8,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import java.math.BigDecimal; import io.swagger.client.model.Client; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java index fdcce26c48c..8ff0a91ce9d 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java @@ -8,6 +8,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import io.swagger.client.model.Client; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/PetApi.java index 03ef3a75065..7ade1e0d697 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/PetApi.java @@ -8,6 +8,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import java.io.File; import io.swagger.client.model.ModelApiResponse; @@ -119,7 +120,7 @@ Completable updatePetWithForm( @retrofit2.http.Multipart @POST("pet/{petId}/uploadImage") Observable uploadFile( - @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part("file\"; filename=\"file") RequestBody file + @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part MultipartBody.Part file ); } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/StoreApi.java index 541c8c33964..c09f971d51f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/StoreApi.java @@ -8,6 +8,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import io.swagger.client.model.Order; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/UserApi.java index 91f9c495e3f..dd1ec578abf 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/api/UserApi.java @@ -8,6 +8,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; +import okhttp3.MultipartBody; import io.swagger.client.model.User; @@ -64,7 +65,7 @@ Completable deleteUser( /** * Get user by user name * - * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return Observable<User> */ @GET("user/{username}")