Skip to content

Commit

Permalink
Revert "[java-retrofit2] Support payload for DELETE method (#19056)" (#…
Browse files Browse the repository at this point in the history
…19100)

This reverts commit 9c4664a.
  • Loading branch information
vbauer authored Jul 7, 2024
1 parent 7f6d2d8 commit 72cdb70
Show file tree
Hide file tree
Showing 19 changed files with 112 additions and 112 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public interface {{classname}} {
{{/-first}}
{{/prioritizedContentTypes}}
{{/formParams}}
@HTTP(method = "{{{httpMethod}}}", path = "{{{path}}}"{{#allParams}}{{#isBodyParam}}, hasBody = true{{/isBodyParam}}{{/allParams}})
@{{httpMethod}}("{{{path}}}")
{{^doNotUseRx}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{#useRxJava3}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava3}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{{returnType}}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} {{operationId}}({{^allParams}});{{/allParams}}
{{#allParams}}{{>libraries/retrofit2/queryParams}}{{>libraries/retrofit2/pathParams}}{{>libraries/retrofit2/headerParams}}{{>libraries/retrofit2/bodyParams}}{{>libraries/retrofit2/formParams}}{{^-last}}, {{/-last}}{{#-last}}
);{{/-last}}{{/allParams}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public interface AnotherFakeApi {
@Headers({
"Content-Type:application/json"
})
@HTTP(method = "PATCH", path = "another-fake/dummy", hasBody = true)
@PATCH("another-fake/dummy")
Call<Client> call123testSpecialTags(
@retrofit2.http.Header("uuid_test") UUID uuidTest, @retrofit2.http.Body Client body
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public interface FakeApi {
@Headers({
"Content-Type:application/xml"
})
@HTTP(method = "POST", path = "fake/create_xml_item", hasBody = true)
@POST("fake/create_xml_item")
Call<Void> createXmlItem(
@retrofit2.http.Body XmlItem xmlItem
);
Expand All @@ -46,7 +46,7 @@ Call<Void> createXmlItem(
* @param body Input boolean as post body (optional)
* @return Call&lt;Boolean&gt;
*/
@HTTP(method = "POST", path = "fake/outer/boolean", hasBody = true)
@POST("fake/outer/boolean")
Call<Boolean> fakeOuterBooleanSerialize(
@retrofit2.http.Body Boolean body
);
Expand All @@ -57,7 +57,7 @@ Call<Boolean> fakeOuterBooleanSerialize(
* @param body Input composite as post body (optional)
* @return Call&lt;OuterComposite&gt;
*/
@HTTP(method = "POST", path = "fake/outer/composite", hasBody = true)
@POST("fake/outer/composite")
Call<OuterComposite> fakeOuterCompositeSerialize(
@retrofit2.http.Body OuterComposite body
);
Expand All @@ -68,7 +68,7 @@ Call<OuterComposite> fakeOuterCompositeSerialize(
* @param body Input number as post body (optional)
* @return Call&lt;BigDecimal&gt;
*/
@HTTP(method = "POST", path = "fake/outer/number", hasBody = true)
@POST("fake/outer/number")
Call<BigDecimal> fakeOuterNumberSerialize(
@retrofit2.http.Body BigDecimal body
);
Expand All @@ -79,7 +79,7 @@ Call<BigDecimal> fakeOuterNumberSerialize(
* @param body Input string as post body (optional)
* @return Call&lt;String&gt;
*/
@HTTP(method = "POST", path = "fake/outer/string", hasBody = true)
@POST("fake/outer/string")
Call<String> fakeOuterStringSerialize(
@retrofit2.http.Body String body
);
Expand All @@ -93,7 +93,7 @@ Call<String> fakeOuterStringSerialize(
@Headers({
"Content-Type:application/json"
})
@HTTP(method = "PUT", path = "fake/body-with-file-schema", hasBody = true)
@PUT("fake/body-with-file-schema")
Call<Void> testBodyWithFileSchema(
@retrofit2.http.Body FileSchemaTestClass body
);
Expand All @@ -108,7 +108,7 @@ Call<Void> testBodyWithFileSchema(
@Headers({
"Content-Type:application/json"
})
@HTTP(method = "PUT", path = "fake/body-with-query-params", hasBody = true)
@PUT("fake/body-with-query-params")
Call<Void> testBodyWithQueryParams(
@retrofit2.http.Query("query") String query, @retrofit2.http.Body User body
);
Expand All @@ -122,7 +122,7 @@ Call<Void> testBodyWithQueryParams(
@Headers({
"Content-Type:application/json"
})
@HTTP(method = "PATCH", path = "fake", hasBody = true)
@PATCH("fake")
Call<Client> testClientModel(
@retrofit2.http.Body Client body
);
Expand All @@ -147,7 +147,7 @@ Call<Client> testClientModel(
* @return Call&lt;Void&gt;
*/
@retrofit2.http.FormUrlEncoded
@HTTP(method = "POST", path = "fake")
@POST("fake")
Call<Void> testEndpointParameters(
@retrofit2.http.Field("number") BigDecimal number, @retrofit2.http.Field("double") Double _double, @retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit2.http.Field("byte") byte[] _byte, @retrofit2.http.Field("integer") Integer integer, @retrofit2.http.Field("int32") Integer int32, @retrofit2.http.Field("int64") Long int64, @retrofit2.http.Field("float") Float _float, @retrofit2.http.Field("string") String string, @retrofit2.http.Field("binary") MultipartBody.Part binary, @retrofit2.http.Field("date") LocalDate date, @retrofit2.http.Field("dateTime") OffsetDateTime dateTime, @retrofit2.http.Field("password") String password, @retrofit2.http.Field("callback") String paramCallback
);
Expand All @@ -166,7 +166,7 @@ Call<Void> testEndpointParameters(
* @return Call&lt;Void&gt;
*/
@retrofit2.http.FormUrlEncoded
@HTTP(method = "GET", path = "fake")
@GET("fake")
Call<Void> testEnumParameters(
@retrofit2.http.Header("enum_header_string_array") List<String> enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit2.http.Query("enum_query_string") String enumQueryString, @retrofit2.http.Query("enum_query_integer") Integer enumQueryInteger, @retrofit2.http.Query("enum_query_double") Double enumQueryDouble, @retrofit2.http.Field("enum_form_string_array") List<String> enumFormStringArray, @retrofit2.http.Field("enum_form_string") String enumFormString
);
Expand All @@ -182,7 +182,7 @@ Call<Void> testEnumParameters(
* @param int64Group Integer in group parameters (optional)
* @return Call&lt;Void&gt;
*/
@HTTP(method = "DELETE", path = "fake")
@DELETE("fake")
Call<Void> testGroupParameters(
@retrofit2.http.Query("required_string_group") Integer requiredStringGroup, @retrofit2.http.Header("required_boolean_group") Boolean requiredBooleanGroup, @retrofit2.http.Query("required_int64_group") Long requiredInt64Group, @retrofit2.http.Query("string_group") Integer stringGroup, @retrofit2.http.Header("boolean_group") Boolean booleanGroup, @retrofit2.http.Query("int64_group") Long int64Group
);
Expand All @@ -196,7 +196,7 @@ Call<Void> testGroupParameters(
@Headers({
"Content-Type:application/json"
})
@HTTP(method = "POST", path = "fake/inline-additionalProperties", hasBody = true)
@POST("fake/inline-additionalProperties")
Call<Void> testInlineAdditionalProperties(
@retrofit2.http.Body Map<String, String> param
);
Expand All @@ -209,7 +209,7 @@ Call<Void> testInlineAdditionalProperties(
* @return Call&lt;Void&gt;
*/
@retrofit2.http.FormUrlEncoded
@HTTP(method = "GET", path = "fake/jsonFormData")
@GET("fake/jsonFormData")
Call<Void> testJsonFormData(
@retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2
);
Expand All @@ -224,7 +224,7 @@ Call<Void> testJsonFormData(
* @param context (required)
* @return Call&lt;Void&gt;
*/
@HTTP(method = "PUT", path = "fake/test-query-parameters")
@PUT("fake/test-query-parameters")
Call<Void> testQueryParameterCollectionFormat(
@retrofit2.http.Query("pipe") CSVParams pipe, @retrofit2.http.Query("ioutil") CSVParams ioutil, @retrofit2.http.Query("http") SSVParams http, @retrofit2.http.Query("url") CSVParams url, @retrofit2.http.Query("context") List<String> context
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public interface FakeClassnameTags123Api {
@Headers({
"Content-Type:application/json"
})
@HTTP(method = "PATCH", path = "fake_classname_test", hasBody = true)
@PATCH("fake_classname_test")
Call<Client> testClassname(
@retrofit2.http.Body Client body
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public interface PetApi {
@Headers({
"Content-Type:application/json"
})
@HTTP(method = "POST", path = "pet", hasBody = true)
@POST("pet")
Call<Void> addPet(
@retrofit2.http.Body Pet body
);
Expand All @@ -42,7 +42,7 @@ Call<Void> addPet(
* @param apiKey (optional)
* @return Call&lt;Void&gt;
*/
@HTTP(method = "DELETE", path = "pet/{petId}")
@DELETE("pet/{petId}")
Call<Void> deletePet(
@retrofit2.http.Path("petId") Long petId, @retrofit2.http.Header("api_key") String apiKey
);
Expand All @@ -53,7 +53,7 @@ Call<Void> deletePet(
* @param status Status values that need to be considered for filter (required)
* @return Call&lt;List&lt;Pet&gt;&gt;
*/
@HTTP(method = "GET", path = "pet/findByStatus")
@GET("pet/findByStatus")
Call<List<Pet>> findPetsByStatus(
@retrofit2.http.Query("status") CSVParams status
);
Expand All @@ -66,7 +66,7 @@ Call<List<Pet>> findPetsByStatus(
* @deprecated
*/
@Deprecated
@HTTP(method = "GET", path = "pet/findByTags")
@GET("pet/findByTags")
Call<Set<Pet>> findPetsByTags(
@retrofit2.http.Query("tags") CSVParams tags
);
Expand All @@ -77,7 +77,7 @@ Call<Set<Pet>> findPetsByTags(
* @param petId ID of pet to return (required)
* @return Call&lt;Pet&gt;
*/
@HTTP(method = "GET", path = "pet/{petId}")
@GET("pet/{petId}")
Call<Pet> getPetById(
@retrofit2.http.Path("petId") Long petId
);
Expand All @@ -91,7 +91,7 @@ Call<Pet> getPetById(
@Headers({
"Content-Type:application/json"
})
@HTTP(method = "PUT", path = "pet", hasBody = true)
@PUT("pet")
Call<Void> updatePet(
@retrofit2.http.Body Pet body
);
Expand All @@ -105,7 +105,7 @@ Call<Void> updatePet(
* @return Call&lt;Void&gt;
*/
@retrofit2.http.FormUrlEncoded
@HTTP(method = "POST", path = "pet/{petId}")
@POST("pet/{petId}")
Call<Void> updatePetWithForm(
@retrofit2.http.Path("petId") Long petId, @retrofit2.http.Field("name") String name, @retrofit2.http.Field("status") String status
);
Expand All @@ -119,7 +119,7 @@ Call<Void> updatePetWithForm(
* @return Call&lt;ModelApiResponse&gt;
*/
@retrofit2.http.Multipart
@HTTP(method = "POST", path = "pet/{petId}/uploadImage")
@POST("pet/{petId}/uploadImage")
Call<ModelApiResponse> uploadFile(
@retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part MultipartBody.Part _file
);
Expand All @@ -133,7 +133,7 @@ Call<ModelApiResponse> uploadFile(
* @return Call&lt;ModelApiResponse&gt;
*/
@retrofit2.http.Multipart
@HTTP(method = "POST", path = "fake/{petId}/uploadImageWithRequiredFile")
@POST("fake/{petId}/uploadImageWithRequiredFile")
Call<ModelApiResponse> uploadFileWithRequiredFile(
@retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part MultipartBody.Part requiredFile, @retrofit2.http.Part("additionalMetadata") String additionalMetadata
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public interface StoreApi {
* @param orderId ID of the order that needs to be deleted (required)
* @return Call&lt;Void&gt;
*/
@HTTP(method = "DELETE", path = "store/order/{order_id}")
@DELETE("store/order/{order_id}")
Call<Void> deleteOrder(
@retrofit2.http.Path("order_id") String orderId
);
Expand All @@ -34,7 +34,7 @@ Call<Void> deleteOrder(
* Returns a map of status codes to quantities
* @return Call&lt;Map&lt;String, Integer&gt;&gt;
*/
@HTTP(method = "GET", path = "store/inventory")
@GET("store/inventory")
Call<Map<String, Integer>> getInventory();


Expand All @@ -44,7 +44,7 @@ Call<Void> deleteOrder(
* @param orderId ID of pet that needs to be fetched (required)
* @return Call&lt;Order&gt;
*/
@HTTP(method = "GET", path = "store/order/{order_id}")
@GET("store/order/{order_id}")
Call<Order> getOrderById(
@retrofit2.http.Path("order_id") Long orderId
);
Expand All @@ -55,7 +55,7 @@ Call<Order> getOrderById(
* @param body order placed for purchasing the pet (required)
* @return Call&lt;Order&gt;
*/
@HTTP(method = "POST", path = "store/order", hasBody = true)
@POST("store/order")
Call<Order> placeOrder(
@retrofit2.http.Body Order body
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public interface UserApi {
* @param body Created user object (required)
* @return Call&lt;Void&gt;
*/
@HTTP(method = "POST", path = "user", hasBody = true)
@POST("user")
Call<Void> createUser(
@retrofit2.http.Body User body
);
Expand All @@ -36,7 +36,7 @@ Call<Void> createUser(
* @param body List of user object (required)
* @return Call&lt;Void&gt;
*/
@HTTP(method = "POST", path = "user/createWithArray", hasBody = true)
@POST("user/createWithArray")
Call<Void> createUsersWithArrayInput(
@retrofit2.http.Body List<User> body
);
Expand All @@ -47,7 +47,7 @@ Call<Void> createUsersWithArrayInput(
* @param body List of user object (required)
* @return Call&lt;Void&gt;
*/
@HTTP(method = "POST", path = "user/createWithList", hasBody = true)
@POST("user/createWithList")
Call<Void> createUsersWithListInput(
@retrofit2.http.Body List<User> body
);
Expand All @@ -58,7 +58,7 @@ Call<Void> createUsersWithListInput(
* @param username The name that needs to be deleted (required)
* @return Call&lt;Void&gt;
*/
@HTTP(method = "DELETE", path = "user/{username}")
@DELETE("user/{username}")
Call<Void> deleteUser(
@retrofit2.http.Path("username") String username
);
Expand All @@ -69,7 +69,7 @@ Call<Void> deleteUser(
* @param username The name that needs to be fetched. Use user1 for testing. (required)
* @return Call&lt;User&gt;
*/
@HTTP(method = "GET", path = "user/{username}")
@GET("user/{username}")
Call<User> getUserByName(
@retrofit2.http.Path("username") String username
);
Expand All @@ -81,7 +81,7 @@ Call<User> getUserByName(
* @param password The password for login in clear text (required)
* @return Call&lt;String&gt;
*/
@HTTP(method = "GET", path = "user/login")
@GET("user/login")
Call<String> loginUser(
@retrofit2.http.Query("username") String username, @retrofit2.http.Query("password") String password
);
Expand All @@ -91,7 +91,7 @@ Call<String> loginUser(
*
* @return Call&lt;Void&gt;
*/
@HTTP(method = "GET", path = "user/logout")
@GET("user/logout")
Call<Void> logoutUser();


Expand All @@ -102,7 +102,7 @@ Call<String> loginUser(
* @param body Updated user object (required)
* @return Call&lt;Void&gt;
*/
@HTTP(method = "PUT", path = "user/{username}", hasBody = true)
@PUT("user/{username}")
Call<Void> updateUser(
@retrofit2.http.Path("username") String username, @retrofit2.http.Body User body
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public interface AnotherFakeApi {
@Headers({
"Content-Type:application/json"
})
@HTTP(method = "PATCH", path = "another-fake/dummy", hasBody = true)
@PATCH("another-fake/dummy")
Observable<Client> call123testSpecialTags(
@retrofit2.http.Header("uuid_test") UUID uuidTest, @retrofit2.http.Body Client body
);
Expand Down
Loading

0 comments on commit 72cdb70

Please sign in to comment.