diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api.mustache index dd521a5fc87..0e8b8f22284 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/api.mustache @@ -74,7 +74,7 @@ public interface {{classname}} { {{/-first}} {{/prioritizedContentTypes}} {{/formParams}} - @{{httpMethod}}("{{{path}}}") + @HTTP(method = "{{{httpMethod}}}", path = "{{{path}}}"{{#allParams}}{{#isBodyParam}}, hasBody = true{{/isBodyParam}}{{/allParams}}) {{^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}} diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index cde24069691..cffcafd7d76 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -29,7 +29,7 @@ public interface AnotherFakeApi { @Headers({ "Content-Type:application/json" }) - @PATCH("another-fake/dummy") + @HTTP(method = "PATCH", path = "another-fake/dummy", hasBody = true) Call call123testSpecialTags( @retrofit2.http.Header("uuid_test") UUID uuidTest, @retrofit2.http.Body Client body ); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java index e00e4eb6812..8c629f9b8c4 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -35,7 +35,7 @@ public interface FakeApi { @Headers({ "Content-Type:application/xml" }) - @POST("fake/create_xml_item") + @HTTP(method = "POST", path = "fake/create_xml_item", hasBody = true) Call createXmlItem( @retrofit2.http.Body XmlItem xmlItem ); @@ -46,7 +46,7 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Call<Boolean> */ - @POST("fake/outer/boolean") + @HTTP(method = "POST", path = "fake/outer/boolean", hasBody = true) Call fakeOuterBooleanSerialize( @retrofit2.http.Body Boolean body ); @@ -57,7 +57,7 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Call<OuterComposite> */ - @POST("fake/outer/composite") + @HTTP(method = "POST", path = "fake/outer/composite", hasBody = true) Call fakeOuterCompositeSerialize( @retrofit2.http.Body OuterComposite body ); @@ -68,7 +68,7 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Call<BigDecimal> */ - @POST("fake/outer/number") + @HTTP(method = "POST", path = "fake/outer/number", hasBody = true) Call fakeOuterNumberSerialize( @retrofit2.http.Body BigDecimal body ); @@ -79,7 +79,7 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Call<String> */ - @POST("fake/outer/string") + @HTTP(method = "POST", path = "fake/outer/string", hasBody = true) Call fakeOuterStringSerialize( @retrofit2.http.Body String body ); @@ -93,7 +93,7 @@ public interface FakeApi { @Headers({ "Content-Type:application/json" }) - @PUT("fake/body-with-file-schema") + @HTTP(method = "PUT", path = "fake/body-with-file-schema", hasBody = true) Call testBodyWithFileSchema( @retrofit2.http.Body FileSchemaTestClass body ); @@ -108,7 +108,7 @@ public interface FakeApi { @Headers({ "Content-Type:application/json" }) - @PUT("fake/body-with-query-params") + @HTTP(method = "PUT", path = "fake/body-with-query-params", hasBody = true) Call testBodyWithQueryParams( @retrofit2.http.Query("query") String query, @retrofit2.http.Body User body ); @@ -122,7 +122,7 @@ public interface FakeApi { @Headers({ "Content-Type:application/json" }) - @PATCH("fake") + @HTTP(method = "PATCH", path = "fake", hasBody = true) Call testClientModel( @retrofit2.http.Body Client body ); @@ -147,7 +147,7 @@ public interface FakeApi { * @return Call<Void> */ @retrofit2.http.FormUrlEncoded - @POST("fake") + @HTTP(method = "POST", path = "fake") Call testEndpointParameters( @retrofit2.http.Field("number") BigDecimal number, @retrofit2.http.Field("double") Double _double, @retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit2.http.Field("byte") byte[] _byte, @retrofit2.http.Field("integer") Integer integer, @retrofit2.http.Field("int32") Integer int32, @retrofit2.http.Field("int64") Long int64, @retrofit2.http.Field("float") Float _float, @retrofit2.http.Field("string") String string, @retrofit2.http.Field("binary") 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 ); @@ -166,7 +166,7 @@ public interface FakeApi { * @return Call<Void> */ @retrofit2.http.FormUrlEncoded - @GET("fake") + @HTTP(method = "GET", path = "fake") Call testEnumParameters( @retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit2.http.Query("enum_query_string") String enumQueryString, @retrofit2.http.Query("enum_query_integer") Integer enumQueryInteger, @retrofit2.http.Query("enum_query_double") Double enumQueryDouble, @retrofit2.http.Field("enum_form_string_array") List enumFormStringArray, @retrofit2.http.Field("enum_form_string") String enumFormString ); @@ -182,7 +182,7 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Call<Void> */ - @DELETE("fake") + @HTTP(method = "DELETE", path = "fake") Call 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 ); @@ -196,7 +196,7 @@ public interface FakeApi { @Headers({ "Content-Type:application/json" }) - @POST("fake/inline-additionalProperties") + @HTTP(method = "POST", path = "fake/inline-additionalProperties", hasBody = true) Call testInlineAdditionalProperties( @retrofit2.http.Body Map param ); @@ -209,7 +209,7 @@ public interface FakeApi { * @return Call<Void> */ @retrofit2.http.FormUrlEncoded - @GET("fake/jsonFormData") + @HTTP(method = "GET", path = "fake/jsonFormData") Call testJsonFormData( @retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2 ); @@ -224,7 +224,7 @@ public interface FakeApi { * @param context (required) * @return Call<Void> */ - @PUT("fake/test-query-parameters") + @HTTP(method = "PUT", path = "fake/test-query-parameters") Call 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 context ); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 849a8e5a8ee..5d6aceb4eb2 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -27,7 +27,7 @@ public interface FakeClassnameTags123Api { @Headers({ "Content-Type:application/json" }) - @PATCH("fake_classname_test") + @HTTP(method = "PATCH", path = "fake_classname_test", hasBody = true) Call testClassname( @retrofit2.http.Body Client body ); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/PetApi.java index b77df3eb64e..8f5c542e012 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/PetApi.java @@ -30,7 +30,7 @@ public interface PetApi { @Headers({ "Content-Type:application/json" }) - @POST("pet") + @HTTP(method = "POST", path = "pet", hasBody = true) Call addPet( @retrofit2.http.Body Pet body ); @@ -42,7 +42,7 @@ public interface PetApi { * @param apiKey (optional) * @return Call<Void> */ - @DELETE("pet/{petId}") + @HTTP(method = "DELETE", path = "pet/{petId}") Call deletePet( @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Header("api_key") String apiKey ); @@ -53,7 +53,7 @@ public interface PetApi { * @param status Status values that need to be considered for filter (required) * @return Call<List<Pet>> */ - @GET("pet/findByStatus") + @HTTP(method = "GET", path = "pet/findByStatus") Call> findPetsByStatus( @retrofit2.http.Query("status") CSVParams status ); @@ -66,7 +66,7 @@ public interface PetApi { * @deprecated */ @Deprecated - @GET("pet/findByTags") + @HTTP(method = "GET", path = "pet/findByTags") Call> findPetsByTags( @retrofit2.http.Query("tags") CSVParams tags ); @@ -77,7 +77,7 @@ public interface PetApi { * @param petId ID of pet to return (required) * @return Call<Pet> */ - @GET("pet/{petId}") + @HTTP(method = "GET", path = "pet/{petId}") Call getPetById( @retrofit2.http.Path("petId") Long petId ); @@ -91,7 +91,7 @@ public interface PetApi { @Headers({ "Content-Type:application/json" }) - @PUT("pet") + @HTTP(method = "PUT", path = "pet", hasBody = true) Call updatePet( @retrofit2.http.Body Pet body ); @@ -105,7 +105,7 @@ public interface PetApi { * @return Call<Void> */ @retrofit2.http.FormUrlEncoded - @POST("pet/{petId}") + @HTTP(method = "POST", path = "pet/{petId}") Call updatePetWithForm( @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Field("name") String name, @retrofit2.http.Field("status") String status ); @@ -119,7 +119,7 @@ public interface PetApi { * @return Call<ModelApiResponse> */ @retrofit2.http.Multipart - @POST("pet/{petId}/uploadImage") + @HTTP(method = "POST", path = "pet/{petId}/uploadImage") Call uploadFile( @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part MultipartBody.Part _file ); @@ -133,7 +133,7 @@ public interface PetApi { * @return Call<ModelApiResponse> */ @retrofit2.http.Multipart - @POST("fake/{petId}/uploadImageWithRequiredFile") + @HTTP(method = "POST", path = "fake/{petId}/uploadImageWithRequiredFile") Call uploadFileWithRequiredFile( @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part MultipartBody.Part requiredFile, @retrofit2.http.Part("additionalMetadata") String additionalMetadata ); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/StoreApi.java index cc41f2c78b6..4ce289e9e92 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/StoreApi.java @@ -24,7 +24,7 @@ public interface StoreApi { * @param orderId ID of the order that needs to be deleted (required) * @return Call<Void> */ - @DELETE("store/order/{order_id}") + @HTTP(method = "DELETE", path = "store/order/{order_id}") Call deleteOrder( @retrofit2.http.Path("order_id") String orderId ); @@ -34,7 +34,7 @@ public interface StoreApi { * Returns a map of status codes to quantities * @return Call<Map<String, Integer>> */ - @GET("store/inventory") + @HTTP(method = "GET", path = "store/inventory") Call> getInventory(); @@ -44,7 +44,7 @@ public interface StoreApi { * @param orderId ID of pet that needs to be fetched (required) * @return Call<Order> */ - @GET("store/order/{order_id}") + @HTTP(method = "GET", path = "store/order/{order_id}") Call getOrderById( @retrofit2.http.Path("order_id") Long orderId ); @@ -55,7 +55,7 @@ public interface StoreApi { * @param body order placed for purchasing the pet (required) * @return Call<Order> */ - @POST("store/order") + @HTTP(method = "POST", path = "store/order", hasBody = true) Call placeOrder( @retrofit2.http.Body Order body ); diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/UserApi.java index d0618bbdf6c..45e1f664254 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/UserApi.java @@ -25,7 +25,7 @@ public interface UserApi { * @param body Created user object (required) * @return Call<Void> */ - @POST("user") + @HTTP(method = "POST", path = "user", hasBody = true) Call createUser( @retrofit2.http.Body User body ); @@ -36,7 +36,7 @@ public interface UserApi { * @param body List of user object (required) * @return Call<Void> */ - @POST("user/createWithArray") + @HTTP(method = "POST", path = "user/createWithArray", hasBody = true) Call createUsersWithArrayInput( @retrofit2.http.Body List body ); @@ -47,7 +47,7 @@ public interface UserApi { * @param body List of user object (required) * @return Call<Void> */ - @POST("user/createWithList") + @HTTP(method = "POST", path = "user/createWithList", hasBody = true) Call createUsersWithListInput( @retrofit2.http.Body List body ); @@ -58,7 +58,7 @@ public interface UserApi { * @param username The name that needs to be deleted (required) * @return Call<Void> */ - @DELETE("user/{username}") + @HTTP(method = "DELETE", path = "user/{username}") Call deleteUser( @retrofit2.http.Path("username") String username ); @@ -69,7 +69,7 @@ public interface UserApi { * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return Call<User> */ - @GET("user/{username}") + @HTTP(method = "GET", path = "user/{username}") Call getUserByName( @retrofit2.http.Path("username") String username ); @@ -81,7 +81,7 @@ public interface UserApi { * @param password The password for login in clear text (required) * @return Call<String> */ - @GET("user/login") + @HTTP(method = "GET", path = "user/login") Call loginUser( @retrofit2.http.Query("username") String username, @retrofit2.http.Query("password") String password ); @@ -91,7 +91,7 @@ public interface UserApi { * * @return Call<Void> */ - @GET("user/logout") + @HTTP(method = "GET", path = "user/logout") Call logoutUser(); @@ -102,7 +102,7 @@ public interface UserApi { * @param body Updated user object (required) * @return Call<Void> */ - @PUT("user/{username}") + @HTTP(method = "PUT", path = "user/{username}", hasBody = true) Call updateUser( @retrofit2.http.Path("username") String username, @retrofit2.http.Body User body ); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 0a0bdb6eabf..252d64e02ab 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -30,7 +30,7 @@ public interface AnotherFakeApi { @Headers({ "Content-Type:application/json" }) - @PATCH("another-fake/dummy") + @HTTP(method = "PATCH", path = "another-fake/dummy", hasBody = true) Observable call123testSpecialTags( @retrofit2.http.Header("uuid_test") UUID uuidTest, @retrofit2.http.Body Client body ); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java index 6347d08144f..a44e8d1e39b 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeApi.java @@ -36,7 +36,7 @@ public interface FakeApi { @Headers({ "Content-Type:application/xml" }) - @POST("fake/create_xml_item") + @HTTP(method = "POST", path = "fake/create_xml_item", hasBody = true) Completable createXmlItem( @retrofit2.http.Body XmlItem xmlItem ); @@ -47,7 +47,7 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Observable<Boolean> */ - @POST("fake/outer/boolean") + @HTTP(method = "POST", path = "fake/outer/boolean", hasBody = true) Observable fakeOuterBooleanSerialize( @retrofit2.http.Body Boolean body ); @@ -58,7 +58,7 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Observable<OuterComposite> */ - @POST("fake/outer/composite") + @HTTP(method = "POST", path = "fake/outer/composite", hasBody = true) Observable fakeOuterCompositeSerialize( @retrofit2.http.Body OuterComposite body ); @@ -69,7 +69,7 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Observable<BigDecimal> */ - @POST("fake/outer/number") + @HTTP(method = "POST", path = "fake/outer/number", hasBody = true) Observable fakeOuterNumberSerialize( @retrofit2.http.Body BigDecimal body ); @@ -80,7 +80,7 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Observable<String> */ - @POST("fake/outer/string") + @HTTP(method = "POST", path = "fake/outer/string", hasBody = true) Observable fakeOuterStringSerialize( @retrofit2.http.Body String body ); @@ -94,7 +94,7 @@ public interface FakeApi { @Headers({ "Content-Type:application/json" }) - @PUT("fake/body-with-file-schema") + @HTTP(method = "PUT", path = "fake/body-with-file-schema", hasBody = true) Completable testBodyWithFileSchema( @retrofit2.http.Body FileSchemaTestClass body ); @@ -109,7 +109,7 @@ public interface FakeApi { @Headers({ "Content-Type:application/json" }) - @PUT("fake/body-with-query-params") + @HTTP(method = "PUT", path = "fake/body-with-query-params", hasBody = true) Completable testBodyWithQueryParams( @retrofit2.http.Query("query") String query, @retrofit2.http.Body User body ); @@ -123,7 +123,7 @@ public interface FakeApi { @Headers({ "Content-Type:application/json" }) - @PATCH("fake") + @HTTP(method = "PATCH", path = "fake", hasBody = true) Observable testClientModel( @retrofit2.http.Body Client body ); @@ -148,7 +148,7 @@ public interface FakeApi { * @return Completable */ @retrofit2.http.FormUrlEncoded - @POST("fake") + @HTTP(method = "POST", path = "fake") Completable testEndpointParameters( @retrofit2.http.Field("number") BigDecimal number, @retrofit2.http.Field("double") Double _double, @retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit2.http.Field("byte") byte[] _byte, @retrofit2.http.Field("integer") Integer integer, @retrofit2.http.Field("int32") Integer int32, @retrofit2.http.Field("int64") Long int64, @retrofit2.http.Field("float") Float _float, @retrofit2.http.Field("string") String string, @retrofit2.http.Field("binary") 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 ); @@ -167,7 +167,7 @@ public interface FakeApi { * @return Completable */ @retrofit2.http.FormUrlEncoded - @GET("fake") + @HTTP(method = "GET", path = "fake") Completable testEnumParameters( @retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit2.http.Query("enum_query_string") String enumQueryString, @retrofit2.http.Query("enum_query_integer") Integer enumQueryInteger, @retrofit2.http.Query("enum_query_double") Double enumQueryDouble, @retrofit2.http.Field("enum_form_string_array") List enumFormStringArray, @retrofit2.http.Field("enum_form_string") String enumFormString ); @@ -183,7 +183,7 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Completable */ - @DELETE("fake") + @HTTP(method = "DELETE", path = "fake") Completable 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 ); @@ -197,7 +197,7 @@ public interface FakeApi { @Headers({ "Content-Type:application/json" }) - @POST("fake/inline-additionalProperties") + @HTTP(method = "POST", path = "fake/inline-additionalProperties", hasBody = true) Completable testInlineAdditionalProperties( @retrofit2.http.Body Map param ); @@ -210,7 +210,7 @@ public interface FakeApi { * @return Completable */ @retrofit2.http.FormUrlEncoded - @GET("fake/jsonFormData") + @HTTP(method = "GET", path = "fake/jsonFormData") Completable testJsonFormData( @retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2 ); @@ -225,7 +225,7 @@ public interface FakeApi { * @param context (required) * @return Completable */ - @PUT("fake/test-query-parameters") + @HTTP(method = "PUT", path = "fake/test-query-parameters") Completable 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 context ); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 5b14d084bbb..311ada0ba72 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -28,7 +28,7 @@ public interface FakeClassnameTags123Api { @Headers({ "Content-Type:application/json" }) - @PATCH("fake_classname_test") + @HTTP(method = "PATCH", path = "fake_classname_test", hasBody = true) Observable testClassname( @retrofit2.http.Body Client body ); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/PetApi.java index d4de52bf6a4..776c2c8d52c 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/PetApi.java @@ -31,7 +31,7 @@ public interface PetApi { @Headers({ "Content-Type:application/json" }) - @POST("pet") + @HTTP(method = "POST", path = "pet", hasBody = true) Completable addPet( @retrofit2.http.Body Pet body ); @@ -43,7 +43,7 @@ public interface PetApi { * @param apiKey (optional) * @return Completable */ - @DELETE("pet/{petId}") + @HTTP(method = "DELETE", path = "pet/{petId}") Completable deletePet( @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Header("api_key") String apiKey ); @@ -54,7 +54,7 @@ public interface PetApi { * @param status Status values that need to be considered for filter (required) * @return Observable<List<Pet>> */ - @GET("pet/findByStatus") + @HTTP(method = "GET", path = "pet/findByStatus") Observable> findPetsByStatus( @retrofit2.http.Query("status") CSVParams status ); @@ -67,7 +67,7 @@ public interface PetApi { * @deprecated */ @Deprecated - @GET("pet/findByTags") + @HTTP(method = "GET", path = "pet/findByTags") Observable> findPetsByTags( @retrofit2.http.Query("tags") CSVParams tags ); @@ -78,7 +78,7 @@ public interface PetApi { * @param petId ID of pet to return (required) * @return Observable<Pet> */ - @GET("pet/{petId}") + @HTTP(method = "GET", path = "pet/{petId}") Observable getPetById( @retrofit2.http.Path("petId") Long petId ); @@ -92,7 +92,7 @@ public interface PetApi { @Headers({ "Content-Type:application/json" }) - @PUT("pet") + @HTTP(method = "PUT", path = "pet", hasBody = true) Completable updatePet( @retrofit2.http.Body Pet body ); @@ -106,7 +106,7 @@ public interface PetApi { * @return Completable */ @retrofit2.http.FormUrlEncoded - @POST("pet/{petId}") + @HTTP(method = "POST", path = "pet/{petId}") Completable updatePetWithForm( @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Field("name") String name, @retrofit2.http.Field("status") String status ); @@ -120,7 +120,7 @@ public interface PetApi { * @return Observable<ModelApiResponse> */ @retrofit2.http.Multipart - @POST("pet/{petId}/uploadImage") + @HTTP(method = "POST", path = "pet/{petId}/uploadImage") Observable uploadFile( @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part MultipartBody.Part _file ); @@ -134,7 +134,7 @@ public interface PetApi { * @return Observable<ModelApiResponse> */ @retrofit2.http.Multipart - @POST("fake/{petId}/uploadImageWithRequiredFile") + @HTTP(method = "POST", path = "fake/{petId}/uploadImageWithRequiredFile") Observable uploadFileWithRequiredFile( @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part MultipartBody.Part requiredFile, @retrofit2.http.Part("additionalMetadata") String additionalMetadata ); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/StoreApi.java index d49ab1a2005..6445912aa5b 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/StoreApi.java @@ -25,7 +25,7 @@ public interface StoreApi { * @param orderId ID of the order that needs to be deleted (required) * @return Completable */ - @DELETE("store/order/{order_id}") + @HTTP(method = "DELETE", path = "store/order/{order_id}") Completable deleteOrder( @retrofit2.http.Path("order_id") String orderId ); @@ -35,7 +35,7 @@ public interface StoreApi { * Returns a map of status codes to quantities * @return Observable<Map<String, Integer>> */ - @GET("store/inventory") + @HTTP(method = "GET", path = "store/inventory") Observable> getInventory(); @@ -45,7 +45,7 @@ public interface StoreApi { * @param orderId ID of pet that needs to be fetched (required) * @return Observable<Order> */ - @GET("store/order/{order_id}") + @HTTP(method = "GET", path = "store/order/{order_id}") Observable getOrderById( @retrofit2.http.Path("order_id") Long orderId ); @@ -56,7 +56,7 @@ public interface StoreApi { * @param body order placed for purchasing the pet (required) * @return Observable<Order> */ - @POST("store/order") + @HTTP(method = "POST", path = "store/order", hasBody = true) Observable placeOrder( @retrofit2.http.Body Order body ); diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/UserApi.java index ed1141d5376..9b253eddbc5 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/UserApi.java @@ -26,7 +26,7 @@ public interface UserApi { * @param body Created user object (required) * @return Completable */ - @POST("user") + @HTTP(method = "POST", path = "user", hasBody = true) Completable createUser( @retrofit2.http.Body User body ); @@ -37,7 +37,7 @@ public interface UserApi { * @param body List of user object (required) * @return Completable */ - @POST("user/createWithArray") + @HTTP(method = "POST", path = "user/createWithArray", hasBody = true) Completable createUsersWithArrayInput( @retrofit2.http.Body List body ); @@ -48,7 +48,7 @@ public interface UserApi { * @param body List of user object (required) * @return Completable */ - @POST("user/createWithList") + @HTTP(method = "POST", path = "user/createWithList", hasBody = true) Completable createUsersWithListInput( @retrofit2.http.Body List body ); @@ -59,7 +59,7 @@ public interface UserApi { * @param username The name that needs to be deleted (required) * @return Completable */ - @DELETE("user/{username}") + @HTTP(method = "DELETE", path = "user/{username}") Completable deleteUser( @retrofit2.http.Path("username") String username ); @@ -70,7 +70,7 @@ public interface UserApi { * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return Observable<User> */ - @GET("user/{username}") + @HTTP(method = "GET", path = "user/{username}") Observable getUserByName( @retrofit2.http.Path("username") String username ); @@ -82,7 +82,7 @@ public interface UserApi { * @param password The password for login in clear text (required) * @return Observable<String> */ - @GET("user/login") + @HTTP(method = "GET", path = "user/login") Observable loginUser( @retrofit2.http.Query("username") String username, @retrofit2.http.Query("password") String password ); @@ -92,7 +92,7 @@ public interface UserApi { * * @return Completable */ - @GET("user/logout") + @HTTP(method = "GET", path = "user/logout") Completable logoutUser(); @@ -103,7 +103,7 @@ public interface UserApi { * @param body Updated user object (required) * @return Completable */ - @PUT("user/{username}") + @HTTP(method = "PUT", path = "user/{username}", hasBody = true) Completable updateUser( @retrofit2.http.Path("username") String username, @retrofit2.http.Body User body ); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 9c9c5db11c2..74fa0af08b0 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -30,7 +30,7 @@ public interface AnotherFakeApi { @Headers({ "Content-Type:application/json" }) - @PATCH("another-fake/dummy") + @HTTP(method = "PATCH", path = "another-fake/dummy", hasBody = true) Observable call123testSpecialTags( @retrofit2.http.Header("uuid_test") UUID uuidTest, @retrofit2.http.Body Client body ); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/FakeApi.java index 0cabd816244..a499c7d4419 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/FakeApi.java @@ -36,7 +36,7 @@ public interface FakeApi { @Headers({ "Content-Type:application/xml" }) - @POST("fake/create_xml_item") + @HTTP(method = "POST", path = "fake/create_xml_item", hasBody = true) Completable createXmlItem( @retrofit2.http.Body XmlItem xmlItem ); @@ -47,7 +47,7 @@ public interface FakeApi { * @param body Input boolean as post body (optional) * @return Observable<Boolean> */ - @POST("fake/outer/boolean") + @HTTP(method = "POST", path = "fake/outer/boolean", hasBody = true) Observable fakeOuterBooleanSerialize( @retrofit2.http.Body Boolean body ); @@ -58,7 +58,7 @@ public interface FakeApi { * @param body Input composite as post body (optional) * @return Observable<OuterComposite> */ - @POST("fake/outer/composite") + @HTTP(method = "POST", path = "fake/outer/composite", hasBody = true) Observable fakeOuterCompositeSerialize( @retrofit2.http.Body OuterComposite body ); @@ -69,7 +69,7 @@ public interface FakeApi { * @param body Input number as post body (optional) * @return Observable<BigDecimal> */ - @POST("fake/outer/number") + @HTTP(method = "POST", path = "fake/outer/number", hasBody = true) Observable fakeOuterNumberSerialize( @retrofit2.http.Body BigDecimal body ); @@ -80,7 +80,7 @@ public interface FakeApi { * @param body Input string as post body (optional) * @return Observable<String> */ - @POST("fake/outer/string") + @HTTP(method = "POST", path = "fake/outer/string", hasBody = true) Observable fakeOuterStringSerialize( @retrofit2.http.Body String body ); @@ -94,7 +94,7 @@ public interface FakeApi { @Headers({ "Content-Type:application/json" }) - @PUT("fake/body-with-file-schema") + @HTTP(method = "PUT", path = "fake/body-with-file-schema", hasBody = true) Completable testBodyWithFileSchema( @retrofit2.http.Body FileSchemaTestClass body ); @@ -109,7 +109,7 @@ public interface FakeApi { @Headers({ "Content-Type:application/json" }) - @PUT("fake/body-with-query-params") + @HTTP(method = "PUT", path = "fake/body-with-query-params", hasBody = true) Completable testBodyWithQueryParams( @retrofit2.http.Query("query") String query, @retrofit2.http.Body User body ); @@ -123,7 +123,7 @@ public interface FakeApi { @Headers({ "Content-Type:application/json" }) - @PATCH("fake") + @HTTP(method = "PATCH", path = "fake", hasBody = true) Observable testClientModel( @retrofit2.http.Body Client body ); @@ -148,7 +148,7 @@ public interface FakeApi { * @return Completable */ @retrofit2.http.FormUrlEncoded - @POST("fake") + @HTTP(method = "POST", path = "fake") Completable testEndpointParameters( @retrofit2.http.Field("number") BigDecimal number, @retrofit2.http.Field("double") Double _double, @retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit2.http.Field("byte") byte[] _byte, @retrofit2.http.Field("integer") Integer integer, @retrofit2.http.Field("int32") Integer int32, @retrofit2.http.Field("int64") Long int64, @retrofit2.http.Field("float") Float _float, @retrofit2.http.Field("string") String string, @retrofit2.http.Field("binary") 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 ); @@ -167,7 +167,7 @@ public interface FakeApi { * @return Completable */ @retrofit2.http.FormUrlEncoded - @GET("fake") + @HTTP(method = "GET", path = "fake") Completable testEnumParameters( @retrofit2.http.Header("enum_header_string_array") List enumHeaderStringArray, @retrofit2.http.Header("enum_header_string") String enumHeaderString, @retrofit2.http.Query("enum_query_string_array") CSVParams enumQueryStringArray, @retrofit2.http.Query("enum_query_string") String enumQueryString, @retrofit2.http.Query("enum_query_integer") Integer enumQueryInteger, @retrofit2.http.Query("enum_query_double") Double enumQueryDouble, @retrofit2.http.Field("enum_form_string_array") List enumFormStringArray, @retrofit2.http.Field("enum_form_string") String enumFormString ); @@ -183,7 +183,7 @@ public interface FakeApi { * @param int64Group Integer in group parameters (optional) * @return Completable */ - @DELETE("fake") + @HTTP(method = "DELETE", path = "fake") Completable 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 ); @@ -197,7 +197,7 @@ public interface FakeApi { @Headers({ "Content-Type:application/json" }) - @POST("fake/inline-additionalProperties") + @HTTP(method = "POST", path = "fake/inline-additionalProperties", hasBody = true) Completable testInlineAdditionalProperties( @retrofit2.http.Body Map param ); @@ -210,7 +210,7 @@ public interface FakeApi { * @return Completable */ @retrofit2.http.FormUrlEncoded - @GET("fake/jsonFormData") + @HTTP(method = "GET", path = "fake/jsonFormData") Completable testJsonFormData( @retrofit2.http.Field("param") String param, @retrofit2.http.Field("param2") String param2 ); @@ -225,7 +225,7 @@ public interface FakeApi { * @param context (required) * @return Completable */ - @PUT("fake/test-query-parameters") + @HTTP(method = "PUT", path = "fake/test-query-parameters") Completable 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 context ); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index 22e1b056130..345906a6d5f 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -28,7 +28,7 @@ public interface FakeClassnameTags123Api { @Headers({ "Content-Type:application/json" }) - @PATCH("fake_classname_test") + @HTTP(method = "PATCH", path = "fake_classname_test", hasBody = true) Observable testClassname( @retrofit2.http.Body Client body ); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/PetApi.java index 8f97dc331e7..4529cbdc735 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/PetApi.java @@ -31,7 +31,7 @@ public interface PetApi { @Headers({ "Content-Type:application/json" }) - @POST("pet") + @HTTP(method = "POST", path = "pet", hasBody = true) Completable addPet( @retrofit2.http.Body Pet body ); @@ -43,7 +43,7 @@ public interface PetApi { * @param apiKey (optional) * @return Completable */ - @DELETE("pet/{petId}") + @HTTP(method = "DELETE", path = "pet/{petId}") Completable deletePet( @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Header("api_key") String apiKey ); @@ -54,7 +54,7 @@ public interface PetApi { * @param status Status values that need to be considered for filter (required) * @return Observable<List<Pet>> */ - @GET("pet/findByStatus") + @HTTP(method = "GET", path = "pet/findByStatus") Observable> findPetsByStatus( @retrofit2.http.Query("status") CSVParams status ); @@ -67,7 +67,7 @@ public interface PetApi { * @deprecated */ @Deprecated - @GET("pet/findByTags") + @HTTP(method = "GET", path = "pet/findByTags") Observable> findPetsByTags( @retrofit2.http.Query("tags") CSVParams tags ); @@ -78,7 +78,7 @@ public interface PetApi { * @param petId ID of pet to return (required) * @return Observable<Pet> */ - @GET("pet/{petId}") + @HTTP(method = "GET", path = "pet/{petId}") Observable getPetById( @retrofit2.http.Path("petId") Long petId ); @@ -92,7 +92,7 @@ public interface PetApi { @Headers({ "Content-Type:application/json" }) - @PUT("pet") + @HTTP(method = "PUT", path = "pet", hasBody = true) Completable updatePet( @retrofit2.http.Body Pet body ); @@ -106,7 +106,7 @@ public interface PetApi { * @return Completable */ @retrofit2.http.FormUrlEncoded - @POST("pet/{petId}") + @HTTP(method = "POST", path = "pet/{petId}") Completable updatePetWithForm( @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Field("name") String name, @retrofit2.http.Field("status") String status ); @@ -120,7 +120,7 @@ public interface PetApi { * @return Observable<ModelApiResponse> */ @retrofit2.http.Multipart - @POST("pet/{petId}/uploadImage") + @HTTP(method = "POST", path = "pet/{petId}/uploadImage") Observable uploadFile( @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part("additionalMetadata") String additionalMetadata, @retrofit2.http.Part MultipartBody.Part _file ); @@ -134,7 +134,7 @@ public interface PetApi { * @return Observable<ModelApiResponse> */ @retrofit2.http.Multipart - @POST("fake/{petId}/uploadImageWithRequiredFile") + @HTTP(method = "POST", path = "fake/{petId}/uploadImageWithRequiredFile") Observable uploadFileWithRequiredFile( @retrofit2.http.Path("petId") Long petId, @retrofit2.http.Part MultipartBody.Part requiredFile, @retrofit2.http.Part("additionalMetadata") String additionalMetadata ); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/StoreApi.java index 2439a4bcb5d..5c5b4146413 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/StoreApi.java @@ -25,7 +25,7 @@ public interface StoreApi { * @param orderId ID of the order that needs to be deleted (required) * @return Completable */ - @DELETE("store/order/{order_id}") + @HTTP(method = "DELETE", path = "store/order/{order_id}") Completable deleteOrder( @retrofit2.http.Path("order_id") String orderId ); @@ -35,7 +35,7 @@ public interface StoreApi { * Returns a map of status codes to quantities * @return Observable<Map<String, Integer>> */ - @GET("store/inventory") + @HTTP(method = "GET", path = "store/inventory") Observable> getInventory(); @@ -45,7 +45,7 @@ public interface StoreApi { * @param orderId ID of pet that needs to be fetched (required) * @return Observable<Order> */ - @GET("store/order/{order_id}") + @HTTP(method = "GET", path = "store/order/{order_id}") Observable getOrderById( @retrofit2.http.Path("order_id") Long orderId ); @@ -56,7 +56,7 @@ public interface StoreApi { * @param body order placed for purchasing the pet (required) * @return Observable<Order> */ - @POST("store/order") + @HTTP(method = "POST", path = "store/order", hasBody = true) Observable placeOrder( @retrofit2.http.Body Order body ); diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/UserApi.java index 920589a609c..455eaec23a0 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/UserApi.java @@ -26,7 +26,7 @@ public interface UserApi { * @param body Created user object (required) * @return Completable */ - @POST("user") + @HTTP(method = "POST", path = "user", hasBody = true) Completable createUser( @retrofit2.http.Body User body ); @@ -37,7 +37,7 @@ public interface UserApi { * @param body List of user object (required) * @return Completable */ - @POST("user/createWithArray") + @HTTP(method = "POST", path = "user/createWithArray", hasBody = true) Completable createUsersWithArrayInput( @retrofit2.http.Body List body ); @@ -48,7 +48,7 @@ public interface UserApi { * @param body List of user object (required) * @return Completable */ - @POST("user/createWithList") + @HTTP(method = "POST", path = "user/createWithList", hasBody = true) Completable createUsersWithListInput( @retrofit2.http.Body List body ); @@ -59,7 +59,7 @@ public interface UserApi { * @param username The name that needs to be deleted (required) * @return Completable */ - @DELETE("user/{username}") + @HTTP(method = "DELETE", path = "user/{username}") Completable deleteUser( @retrofit2.http.Path("username") String username ); @@ -70,7 +70,7 @@ public interface UserApi { * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return Observable<User> */ - @GET("user/{username}") + @HTTP(method = "GET", path = "user/{username}") Observable getUserByName( @retrofit2.http.Path("username") String username ); @@ -82,7 +82,7 @@ public interface UserApi { * @param password The password for login in clear text (required) * @return Observable<String> */ - @GET("user/login") + @HTTP(method = "GET", path = "user/login") Observable loginUser( @retrofit2.http.Query("username") String username, @retrofit2.http.Query("password") String password ); @@ -92,7 +92,7 @@ public interface UserApi { * * @return Completable */ - @GET("user/logout") + @HTTP(method = "GET", path = "user/logout") Completable logoutUser(); @@ -103,7 +103,7 @@ public interface UserApi { * @param body Updated user object (required) * @return Completable */ - @PUT("user/{username}") + @HTTP(method = "PUT", path = "user/{username}", hasBody = true) Completable updateUser( @retrofit2.http.Path("username") String username, @retrofit2.http.Body User body );