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 0e8b8f22284..dd521a5fc87 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}} - @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}} 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 cffcafd7d76..cde24069691 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" }) - @HTTP(method = "PATCH", path = "another-fake/dummy", hasBody = true) + @PATCH("another-fake/dummy") 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 8c629f9b8c4..e00e4eb6812 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" }) - @HTTP(method = "POST", path = "fake/create_xml_item", hasBody = true) + @POST("fake/create_xml_item") 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> */ - @HTTP(method = "POST", path = "fake/outer/boolean", hasBody = true) + @POST("fake/outer/boolean") 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> */ - @HTTP(method = "POST", path = "fake/outer/composite", hasBody = true) + @POST("fake/outer/composite") 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> */ - @HTTP(method = "POST", path = "fake/outer/number", hasBody = true) + @POST("fake/outer/number") 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> */ - @HTTP(method = "POST", path = "fake/outer/string", hasBody = true) + @POST("fake/outer/string") Call fakeOuterStringSerialize( @retrofit2.http.Body String body ); @@ -93,7 +93,7 @@ public interface FakeApi { @Headers({ "Content-Type:application/json" }) - @HTTP(method = "PUT", path = "fake/body-with-file-schema", hasBody = true) + @PUT("fake/body-with-file-schema") Call testBodyWithFileSchema( @retrofit2.http.Body FileSchemaTestClass body ); @@ -108,7 +108,7 @@ public interface FakeApi { @Headers({ "Content-Type:application/json" }) - @HTTP(method = "PUT", path = "fake/body-with-query-params", hasBody = true) + @PUT("fake/body-with-query-params") 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" }) - @HTTP(method = "PATCH", path = "fake", hasBody = true) + @PATCH("fake") Call testClientModel( @retrofit2.http.Body Client body ); @@ -147,7 +147,7 @@ public interface FakeApi { * @return Call<Void> */ @retrofit2.http.FormUrlEncoded - @HTTP(method = "POST", path = "fake") + @POST("fake") Call testEndpointParameters( @retrofit2.http.Field("number") BigDecimal number, @retrofit2.http.Field("double") Double _double, @retrofit2.http.Field("pattern_without_delimiter") String patternWithoutDelimiter, @retrofit2.http.Field("byte") byte[] _byte, @retrofit2.http.Field("integer") Integer integer, @retrofit2.http.Field("int32") Integer int32, @retrofit2.http.Field("int64") Long int64, @retrofit2.http.Field("float") Float _float, @retrofit2.http.Field("string") String string, @retrofit2.http.Field("binary") 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 - @HTTP(method = "GET", path = "fake") + @GET("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> */ - @HTTP(method = "DELETE", path = "fake") + @DELETE("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" }) - @HTTP(method = "POST", path = "fake/inline-additionalProperties", hasBody = true) + @POST("fake/inline-additionalProperties") Call testInlineAdditionalProperties( @retrofit2.http.Body Map param ); @@ -209,7 +209,7 @@ public interface FakeApi { * @return Call<Void> */ @retrofit2.http.FormUrlEncoded - @HTTP(method = "GET", path = "fake/jsonFormData") + @GET("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> */ - @HTTP(method = "PUT", path = "fake/test-query-parameters") + @PUT("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 5d6aceb4eb2..849a8e5a8ee 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" }) - @HTTP(method = "PATCH", path = "fake_classname_test", hasBody = true) + @PATCH("fake_classname_test") 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 8f5c542e012..b77df3eb64e 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" }) - @HTTP(method = "POST", path = "pet", hasBody = true) + @POST("pet") Call addPet( @retrofit2.http.Body Pet body ); @@ -42,7 +42,7 @@ public interface PetApi { * @param apiKey (optional) * @return Call<Void> */ - @HTTP(method = "DELETE", path = "pet/{petId}") + @DELETE("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>> */ - @HTTP(method = "GET", path = "pet/findByStatus") + @GET("pet/findByStatus") Call> findPetsByStatus( @retrofit2.http.Query("status") CSVParams status ); @@ -66,7 +66,7 @@ public interface PetApi { * @deprecated */ @Deprecated - @HTTP(method = "GET", path = "pet/findByTags") + @GET("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> */ - @HTTP(method = "GET", path = "pet/{petId}") + @GET("pet/{petId}") Call getPetById( @retrofit2.http.Path("petId") Long petId ); @@ -91,7 +91,7 @@ public interface PetApi { @Headers({ "Content-Type:application/json" }) - @HTTP(method = "PUT", path = "pet", hasBody = true) + @PUT("pet") Call updatePet( @retrofit2.http.Body Pet body ); @@ -105,7 +105,7 @@ public interface PetApi { * @return Call<Void> */ @retrofit2.http.FormUrlEncoded - @HTTP(method = "POST", path = "pet/{petId}") + @POST("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 - @HTTP(method = "POST", path = "pet/{petId}/uploadImage") + @POST("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 - @HTTP(method = "POST", path = "fake/{petId}/uploadImageWithRequiredFile") + @POST("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 4ce289e9e92..cc41f2c78b6 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> */ - @HTTP(method = "DELETE", path = "store/order/{order_id}") + @DELETE("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>> */ - @HTTP(method = "GET", path = "store/inventory") + @GET("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> */ - @HTTP(method = "GET", path = "store/order/{order_id}") + @GET("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> */ - @HTTP(method = "POST", path = "store/order", hasBody = true) + @POST("store/order") 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 45e1f664254..d0618bbdf6c 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> */ - @HTTP(method = "POST", path = "user", hasBody = true) + @POST("user") Call createUser( @retrofit2.http.Body User body ); @@ -36,7 +36,7 @@ public interface UserApi { * @param body List of user object (required) * @return Call<Void> */ - @HTTP(method = "POST", path = "user/createWithArray", hasBody = true) + @POST("user/createWithArray") Call createUsersWithArrayInput( @retrofit2.http.Body List body ); @@ -47,7 +47,7 @@ public interface UserApi { * @param body List of user object (required) * @return Call<Void> */ - @HTTP(method = "POST", path = "user/createWithList", hasBody = true) + @POST("user/createWithList") 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> */ - @HTTP(method = "DELETE", path = "user/{username}") + @DELETE("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> */ - @HTTP(method = "GET", path = "user/{username}") + @GET("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> */ - @HTTP(method = "GET", path = "user/login") + @GET("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> */ - @HTTP(method = "GET", path = "user/logout") + @GET("user/logout") Call logoutUser(); @@ -102,7 +102,7 @@ public interface UserApi { * @param body Updated user object (required) * @return Call<Void> */ - @HTTP(method = "PUT", path = "user/{username}", hasBody = true) + @PUT("user/{username}") 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 252d64e02ab..0a0bdb6eabf 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" }) - @HTTP(method = "PATCH", path = "another-fake/dummy", hasBody = true) + @PATCH("another-fake/dummy") 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 a44e8d1e39b..6347d08144f 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" }) - @HTTP(method = "POST", path = "fake/create_xml_item", hasBody = true) + @POST("fake/create_xml_item") 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> */ - @HTTP(method = "POST", path = "fake/outer/boolean", hasBody = true) + @POST("fake/outer/boolean") 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> */ - @HTTP(method = "POST", path = "fake/outer/composite", hasBody = true) + @POST("fake/outer/composite") 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> */ - @HTTP(method = "POST", path = "fake/outer/number", hasBody = true) + @POST("fake/outer/number") 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> */ - @HTTP(method = "POST", path = "fake/outer/string", hasBody = true) + @POST("fake/outer/string") Observable fakeOuterStringSerialize( @retrofit2.http.Body String body ); @@ -94,7 +94,7 @@ public interface FakeApi { @Headers({ "Content-Type:application/json" }) - @HTTP(method = "PUT", path = "fake/body-with-file-schema", hasBody = true) + @PUT("fake/body-with-file-schema") Completable testBodyWithFileSchema( @retrofit2.http.Body FileSchemaTestClass body ); @@ -109,7 +109,7 @@ public interface FakeApi { @Headers({ "Content-Type:application/json" }) - @HTTP(method = "PUT", path = "fake/body-with-query-params", hasBody = true) + @PUT("fake/body-with-query-params") 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" }) - @HTTP(method = "PATCH", path = "fake", hasBody = true) + @PATCH("fake") Observable testClientModel( @retrofit2.http.Body Client body ); @@ -148,7 +148,7 @@ public interface FakeApi { * @return Completable */ @retrofit2.http.FormUrlEncoded - @HTTP(method = "POST", path = "fake") + @POST("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 - @HTTP(method = "GET", path = "fake") + @GET("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 */ - @HTTP(method = "DELETE", path = "fake") + @DELETE("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" }) - @HTTP(method = "POST", path = "fake/inline-additionalProperties", hasBody = true) + @POST("fake/inline-additionalProperties") Completable testInlineAdditionalProperties( @retrofit2.http.Body Map param ); @@ -210,7 +210,7 @@ public interface FakeApi { * @return Completable */ @retrofit2.http.FormUrlEncoded - @HTTP(method = "GET", path = "fake/jsonFormData") + @GET("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 */ - @HTTP(method = "PUT", path = "fake/test-query-parameters") + @PUT("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 311ada0ba72..5b14d084bbb 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" }) - @HTTP(method = "PATCH", path = "fake_classname_test", hasBody = true) + @PATCH("fake_classname_test") 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 776c2c8d52c..d4de52bf6a4 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" }) - @HTTP(method = "POST", path = "pet", hasBody = true) + @POST("pet") Completable addPet( @retrofit2.http.Body Pet body ); @@ -43,7 +43,7 @@ public interface PetApi { * @param apiKey (optional) * @return Completable */ - @HTTP(method = "DELETE", path = "pet/{petId}") + @DELETE("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>> */ - @HTTP(method = "GET", path = "pet/findByStatus") + @GET("pet/findByStatus") Observable> findPetsByStatus( @retrofit2.http.Query("status") CSVParams status ); @@ -67,7 +67,7 @@ public interface PetApi { * @deprecated */ @Deprecated - @HTTP(method = "GET", path = "pet/findByTags") + @GET("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> */ - @HTTP(method = "GET", path = "pet/{petId}") + @GET("pet/{petId}") Observable getPetById( @retrofit2.http.Path("petId") Long petId ); @@ -92,7 +92,7 @@ public interface PetApi { @Headers({ "Content-Type:application/json" }) - @HTTP(method = "PUT", path = "pet", hasBody = true) + @PUT("pet") Completable updatePet( @retrofit2.http.Body Pet body ); @@ -106,7 +106,7 @@ public interface PetApi { * @return Completable */ @retrofit2.http.FormUrlEncoded - @HTTP(method = "POST", path = "pet/{petId}") + @POST("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 - @HTTP(method = "POST", path = "pet/{petId}/uploadImage") + @POST("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 - @HTTP(method = "POST", path = "fake/{petId}/uploadImageWithRequiredFile") + @POST("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 6445912aa5b..d49ab1a2005 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 */ - @HTTP(method = "DELETE", path = "store/order/{order_id}") + @DELETE("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>> */ - @HTTP(method = "GET", path = "store/inventory") + @GET("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> */ - @HTTP(method = "GET", path = "store/order/{order_id}") + @GET("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> */ - @HTTP(method = "POST", path = "store/order", hasBody = true) + @POST("store/order") 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 9b253eddbc5..ed1141d5376 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 */ - @HTTP(method = "POST", path = "user", hasBody = true) + @POST("user") Completable createUser( @retrofit2.http.Body User body ); @@ -37,7 +37,7 @@ public interface UserApi { * @param body List of user object (required) * @return Completable */ - @HTTP(method = "POST", path = "user/createWithArray", hasBody = true) + @POST("user/createWithArray") Completable createUsersWithArrayInput( @retrofit2.http.Body List body ); @@ -48,7 +48,7 @@ public interface UserApi { * @param body List of user object (required) * @return Completable */ - @HTTP(method = "POST", path = "user/createWithList", hasBody = true) + @POST("user/createWithList") 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 */ - @HTTP(method = "DELETE", path = "user/{username}") + @DELETE("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> */ - @HTTP(method = "GET", path = "user/{username}") + @GET("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> */ - @HTTP(method = "GET", path = "user/login") + @GET("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 */ - @HTTP(method = "GET", path = "user/logout") + @GET("user/logout") Completable logoutUser(); @@ -103,7 +103,7 @@ public interface UserApi { * @param body Updated user object (required) * @return Completable */ - @HTTP(method = "PUT", path = "user/{username}", hasBody = true) + @PUT("user/{username}") 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 74fa0af08b0..9c9c5db11c2 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" }) - @HTTP(method = "PATCH", path = "another-fake/dummy", hasBody = true) + @PATCH("another-fake/dummy") 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 a499c7d4419..0cabd816244 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" }) - @HTTP(method = "POST", path = "fake/create_xml_item", hasBody = true) + @POST("fake/create_xml_item") 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> */ - @HTTP(method = "POST", path = "fake/outer/boolean", hasBody = true) + @POST("fake/outer/boolean") 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> */ - @HTTP(method = "POST", path = "fake/outer/composite", hasBody = true) + @POST("fake/outer/composite") 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> */ - @HTTP(method = "POST", path = "fake/outer/number", hasBody = true) + @POST("fake/outer/number") 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> */ - @HTTP(method = "POST", path = "fake/outer/string", hasBody = true) + @POST("fake/outer/string") Observable fakeOuterStringSerialize( @retrofit2.http.Body String body ); @@ -94,7 +94,7 @@ public interface FakeApi { @Headers({ "Content-Type:application/json" }) - @HTTP(method = "PUT", path = "fake/body-with-file-schema", hasBody = true) + @PUT("fake/body-with-file-schema") Completable testBodyWithFileSchema( @retrofit2.http.Body FileSchemaTestClass body ); @@ -109,7 +109,7 @@ public interface FakeApi { @Headers({ "Content-Type:application/json" }) - @HTTP(method = "PUT", path = "fake/body-with-query-params", hasBody = true) + @PUT("fake/body-with-query-params") 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" }) - @HTTP(method = "PATCH", path = "fake", hasBody = true) + @PATCH("fake") Observable testClientModel( @retrofit2.http.Body Client body ); @@ -148,7 +148,7 @@ public interface FakeApi { * @return Completable */ @retrofit2.http.FormUrlEncoded - @HTTP(method = "POST", path = "fake") + @POST("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 - @HTTP(method = "GET", path = "fake") + @GET("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 */ - @HTTP(method = "DELETE", path = "fake") + @DELETE("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" }) - @HTTP(method = "POST", path = "fake/inline-additionalProperties", hasBody = true) + @POST("fake/inline-additionalProperties") Completable testInlineAdditionalProperties( @retrofit2.http.Body Map param ); @@ -210,7 +210,7 @@ public interface FakeApi { * @return Completable */ @retrofit2.http.FormUrlEncoded - @HTTP(method = "GET", path = "fake/jsonFormData") + @GET("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 */ - @HTTP(method = "PUT", path = "fake/test-query-parameters") + @PUT("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 345906a6d5f..22e1b056130 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" }) - @HTTP(method = "PATCH", path = "fake_classname_test", hasBody = true) + @PATCH("fake_classname_test") 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 4529cbdc735..8f97dc331e7 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" }) - @HTTP(method = "POST", path = "pet", hasBody = true) + @POST("pet") Completable addPet( @retrofit2.http.Body Pet body ); @@ -43,7 +43,7 @@ public interface PetApi { * @param apiKey (optional) * @return Completable */ - @HTTP(method = "DELETE", path = "pet/{petId}") + @DELETE("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>> */ - @HTTP(method = "GET", path = "pet/findByStatus") + @GET("pet/findByStatus") Observable> findPetsByStatus( @retrofit2.http.Query("status") CSVParams status ); @@ -67,7 +67,7 @@ public interface PetApi { * @deprecated */ @Deprecated - @HTTP(method = "GET", path = "pet/findByTags") + @GET("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> */ - @HTTP(method = "GET", path = "pet/{petId}") + @GET("pet/{petId}") Observable getPetById( @retrofit2.http.Path("petId") Long petId ); @@ -92,7 +92,7 @@ public interface PetApi { @Headers({ "Content-Type:application/json" }) - @HTTP(method = "PUT", path = "pet", hasBody = true) + @PUT("pet") Completable updatePet( @retrofit2.http.Body Pet body ); @@ -106,7 +106,7 @@ public interface PetApi { * @return Completable */ @retrofit2.http.FormUrlEncoded - @HTTP(method = "POST", path = "pet/{petId}") + @POST("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 - @HTTP(method = "POST", path = "pet/{petId}/uploadImage") + @POST("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 - @HTTP(method = "POST", path = "fake/{petId}/uploadImageWithRequiredFile") + @POST("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 5c5b4146413..2439a4bcb5d 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 */ - @HTTP(method = "DELETE", path = "store/order/{order_id}") + @DELETE("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>> */ - @HTTP(method = "GET", path = "store/inventory") + @GET("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> */ - @HTTP(method = "GET", path = "store/order/{order_id}") + @GET("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> */ - @HTTP(method = "POST", path = "store/order", hasBody = true) + @POST("store/order") 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 455eaec23a0..920589a609c 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 */ - @HTTP(method = "POST", path = "user", hasBody = true) + @POST("user") Completable createUser( @retrofit2.http.Body User body ); @@ -37,7 +37,7 @@ public interface UserApi { * @param body List of user object (required) * @return Completable */ - @HTTP(method = "POST", path = "user/createWithArray", hasBody = true) + @POST("user/createWithArray") Completable createUsersWithArrayInput( @retrofit2.http.Body List body ); @@ -48,7 +48,7 @@ public interface UserApi { * @param body List of user object (required) * @return Completable */ - @HTTP(method = "POST", path = "user/createWithList", hasBody = true) + @POST("user/createWithList") 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 */ - @HTTP(method = "DELETE", path = "user/{username}") + @DELETE("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> */ - @HTTP(method = "GET", path = "user/{username}") + @GET("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> */ - @HTTP(method = "GET", path = "user/login") + @GET("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 */ - @HTTP(method = "GET", path = "user/logout") + @GET("user/logout") Completable logoutUser(); @@ -103,7 +103,7 @@ public interface UserApi { * @param body Updated user object (required) * @return Completable */ - @HTTP(method = "PUT", path = "user/{username}", hasBody = true) + @PUT("user/{username}") Completable updateUser( @retrofit2.http.Path("username") String username, @retrofit2.http.Body User body );