From 2103bab62995e460bde886053f01619188c1beb5 Mon Sep 17 00:00:00 2001 From: Michael Mutin Date: Sun, 19 May 2024 18:55:22 +0200 Subject: [PATCH 1/2] [Java][Client] Add and Fix Deprecation annotation --- .../resources/handlebars/Java/api.mustache | 8 ++-- .../Java/libraries/feign/api.mustache | 12 ++++++ .../Java/libraries/jersey2/api.mustache | 8 ++-- .../Java/libraries/jersey3/api.mustache | 8 ++-- .../Java/libraries/okhttp-gson/api.mustache | 40 +++++++++++++---- .../Java/libraries/okhttp4-gson/api.mustache | 43 ++++++++++++++----- .../Java/libraries/resteasy/api.mustache | 8 ++-- .../Java/libraries/resttemplate/api.mustache | 14 ++++-- .../Java/libraries/retrofit/api.mustache | 6 +++ 9 files changed, 108 insertions(+), 39 deletions(-) diff --git a/src/main/resources/handlebars/Java/api.mustache b/src/main/resources/handlebars/Java/api.mustache index c89b71d372..c5a5742121 100644 --- a/src/main/resources/handlebars/Java/api.mustache +++ b/src/main/resources/handlebars/Java/api.mustache @@ -51,17 +51,17 @@ public class {{classname}} { * @return {{returnType}} {{/returnType}} * @throws ApiException if fails to make API call - {{#isDeprecated}} + {{#vendorExtensions.x-is-deprecated}} * @deprecated - {{/isDeprecated}} + {{/vendorExtensions.x-is-deprecated}} {{#externalDocs}} * {{description}} * @see {{summary}} Documentation {{/externalDocs}} */ - {{#isDeprecated}} + {{#vendorExtensions.x-is-deprecated}} @Deprecated - {{/isDeprecated}} + {{/vendorExtensions.x-is-deprecated}} public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#parameters}}{{{dataType}}} {{paramName}}{{#has this 'more'}}, {{/has}}{{/parameters}}) throws ApiException { Object {{localVariablePrefix}}localVarPostBody = {{^isForm}}{{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}{{/isForm}}{{#isForm}}null{{/isForm}}; {{#parameters}}{{#required}} diff --git a/src/main/resources/handlebars/Java/libraries/feign/api.mustache b/src/main/resources/handlebars/Java/libraries/feign/api.mustache index 4b7bd85243..a65fe792e5 100644 --- a/src/main/resources/handlebars/Java/libraries/feign/api.mustache +++ b/src/main/resources/handlebars/Java/libraries/feign/api.mustache @@ -32,11 +32,17 @@ public interface {{classname}} extends ApiClient.Api { {{#returnType}} * @return {{returnType}} {{/returnType}} + {{#vendorExtensions.x-is-deprecated}} + * @deprecated + {{/vendorExtensions.x-is-deprecated}} {{#externalDocs}} * {{description}} * @see {{summary}} Documentation {{/externalDocs}} */ + {{#vendorExtensions.x-is-deprecated}} + @Deprecated + {{/vendorExtensions.x-is-deprecated}} @RequestLine("{{httpMethod}} {{{path}}}{{#hasQueryParams}}?{{/hasQueryParams}}{{#queryParams}}{{baseName}}={{braces "left"}}{{paramName}}{{braces "right"}}{{#has this 'more'}}&{{/has}}{{/queryParams}}") @Headers({ {{#vendorExtensions.x-contentType}} @@ -78,10 +84,16 @@ public interface {{classname}} extends ApiClient.Api { {{#returnType}} * @return {{returnType}} {{/returnType}} + {{#vendorExtensions.x-is-deprecated}} + * @deprecated + {{/vendorExtensions.x-is-deprecated}} {{#externalDocs}} * {{description}} * @see {{summary}} Documentation{{/externalDocs}} */ + {{#vendorExtensions.x-is-deprecated}} + @Deprecated + {{/vendorExtensions.x-is-deprecated}} @RequestLine("{{httpMethod}} {{{path}}}?{{#queryParams}}{{baseName}}={{braces "left"}}{{paramName}}{{braces "right"}}{{#has this 'more'}}&{{/has}}{{/queryParams}}") @Headers({ {{#vendorExtensions.x-contentType}} diff --git a/src/main/resources/handlebars/Java/libraries/jersey2/api.mustache b/src/main/resources/handlebars/Java/libraries/jersey2/api.mustache index 6e0dda863e..4794fbe66b 100644 --- a/src/main/resources/handlebars/Java/libraries/jersey2/api.mustache +++ b/src/main/resources/handlebars/Java/libraries/jersey2/api.mustache @@ -55,17 +55,17 @@ public class {{classname}} { * @return {{returnType}} {{/returnType}} * @throws ApiException if fails to make API call - {{#isDeprecated}} + {{#vendorExtensions.x-is-deprecated}} * @deprecated - {{/isDeprecated}} + {{/vendorExtensions.x-is-deprecated}} {{#externalDocs}} * {{description}} * @see {{summary}} Documentation {{/externalDocs}} */ - {{#isDeprecated}} + {{#vendorExtensions.x-is-deprecated}} @Deprecated - {{/isDeprecated}} + {{/vendorExtensions.x-is-deprecated}} public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#parameters}}{{{dataType}}} {{paramName}}{{#has this 'more'}}, {{/has}}{{/parameters}}) throws ApiException { Object {{localVariablePrefix}}localVarPostBody = {{^isForm}}{{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}{{/isForm}}{{#isForm}}null{{/isForm}}; {{#parameters}} diff --git a/src/main/resources/handlebars/Java/libraries/jersey3/api.mustache b/src/main/resources/handlebars/Java/libraries/jersey3/api.mustache index 9024d15a92..a7b80b54b6 100644 --- a/src/main/resources/handlebars/Java/libraries/jersey3/api.mustache +++ b/src/main/resources/handlebars/Java/libraries/jersey3/api.mustache @@ -48,17 +48,17 @@ public class {{classname}} { * @return {{returnType}} {{/returnType}} * @throws ApiException if fails to make API call - {{#isDeprecated}} + {{#vendorExtensions.x-is-deprecated}} * @deprecated - {{/isDeprecated}} + {{/vendorExtensions.x-is-deprecated}} {{#externalDocs}} * {{description}} * @see {{summary}} Documentation {{/externalDocs}} */ - {{#isDeprecated}} + {{#vendorExtensions.x-is-deprecated}} @Deprecated - {{/isDeprecated}} + {{/vendorExtensions.x-is-deprecated}} public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#parameters}}{{{dataType}}} {{paramName}}{{#has this 'more'}}, {{/has}}{{/parameters}}) throws ApiException { Object {{localVariablePrefix}}localVarPostBody = {{^isForm}}{{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}{{/isForm}}{{#isForm}}null{{/isForm}}; {{#parameters}} diff --git a/src/main/resources/handlebars/Java/libraries/okhttp-gson/api.mustache b/src/main/resources/handlebars/Java/libraries/okhttp-gson/api.mustache index b1033181f5..c5b436e2b3 100644 --- a/src/main/resources/handlebars/Java/libraries/okhttp-gson/api.mustache +++ b/src/main/resources/handlebars/Java/libraries/okhttp-gson/api.mustache @@ -84,11 +84,17 @@ public class {{classname}} { * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object - {{#externalDocs}} + {{#vendorExtensions.x-is-deprecated}} + * @deprecated + {{/vendorExtensions.x-is-deprecated}} + {{#externalDocs}} * {{description}} * @see {{summary}} Documentation - {{/externalDocs}} + {{/externalDocs}} */ + {{#vendorExtensions.x-is-deprecated}} + @Deprecated + {{/vendorExtensions.x-is-deprecated}} public com.squareup.okhttp.Call {{operationId}}Call({{#parameters}}{{{dataType}}} {{paramName}}, {{/parameters}}final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object {{localVariablePrefix}}localVarPostBody = {{^isForm}}{{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}{{/isForm}}{{#isForm}}null{{/isForm}}; @@ -193,11 +199,17 @@ public class {{classname}} { * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/parameters}}{{#returnType}} * @return {{returnType}}{{/returnType}} * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - {{#externalDocs}} + {{#vendorExtensions.x-is-deprecated}} + * @deprecated + {{/vendorExtensions.x-is-deprecated}} + {{#externalDocs}} * {{description}} * @see {{summary}} Documentation - {{/externalDocs}} + {{/externalDocs}} */ + {{#vendorExtensions.x-is-deprecated}} + @Deprecated + {{/vendorExtensions.x-is-deprecated}} public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#parameters}}{{{dataType}}} {{paramName}}{{#has this 'more'}}, {{/has}}{{/parameters}}) throws ApiException { {{#returnType}}ApiResponse<{{{returnType}}}> {{localVariablePrefix}}resp = {{/returnType}}{{operationId}}WithHttpInfo({{#parameters}}{{paramName}}{{#has this 'more'}}, {{/has}}{{/parameters}});{{#returnType}} return {{localVariablePrefix}}resp.getData();{{/returnType}} @@ -209,11 +221,17 @@ public class {{classname}} { * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/parameters}} * @return ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - {{#externalDocs}} + {{#vendorExtensions.x-is-deprecated}} + * @deprecated + {{/vendorExtensions.x-is-deprecated}} + {{#externalDocs}} * {{description}} * @see {{summary}} Documentation - {{/externalDocs}} + {{/externalDocs}} */ + {{#vendorExtensions.x-is-deprecated}} + @Deprecated + {{/vendorExtensions.x-is-deprecated}} public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#parameters}}{{#if useBeanValidation}}{{>beanValidationQueryParams}}{{/if}}{{{dataType}}} {{paramName}}{{#has this 'more'}}, {{/has}}{{/parameters}}) throws ApiException { com.squareup.okhttp.Call {{localVariablePrefix}}call = {{operationId}}ValidateBeforeCall({{#parameters}}{{paramName}}, {{/parameters}}null, null); {{#returnType}}Type {{localVariablePrefix}}localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); @@ -227,11 +245,17 @@ public class {{classname}} { * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object - {{#externalDocs}} + {{#vendorExtensions.x-is-deprecated}} + * @deprecated + {{/vendorExtensions.x-is-deprecated}} + {{#externalDocs}} * {{description}} * @see {{summary}} Documentation - {{/externalDocs}} + {{/externalDocs}} */ + {{#vendorExtensions.x-is-deprecated}} + @Deprecated + {{/vendorExtensions.x-is-deprecated}} public com.squareup.okhttp.Call {{operationId}}Async({{#parameters}}{{{dataType}}} {{paramName}}, {{/parameters}}final ApiCallback<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{localVariablePrefix}}callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; diff --git a/src/main/resources/handlebars/Java/libraries/okhttp4-gson/api.mustache b/src/main/resources/handlebars/Java/libraries/okhttp4-gson/api.mustache index 4a13e61eea..144f6861cc 100644 --- a/src/main/resources/handlebars/Java/libraries/okhttp4-gson/api.mustache +++ b/src/main/resources/handlebars/Java/libraries/okhttp4-gson/api.mustache @@ -71,11 +71,17 @@ public class {{classname}} { * @param progressRequestListener Progress request listener * @return Call to execute * @throws ApiException If fail to serialize the request body object - {{#externalDocs}} + {{#vendorExtensions.x-is-deprecated}} + * @deprecated + {{/vendorExtensions.x-is-deprecated}} + {{#externalDocs}} * {{description}} * @see {{summary}} Documentation - {{/externalDocs}} + {{/externalDocs}} */ + {{#vendorExtensions.x-is-deprecated}} + @Deprecated + {{/vendorExtensions.x-is-deprecated}} public okhttp3.Call {{operationId}}Call({{#parameters}}{{{dataType}}} {{paramName}}, {{/parameters}}final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object {{localVariablePrefix}}localVarPostBody = {{^isForm}}{{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}{{/isForm}}{{#isForm}}null{{/isForm}}; @@ -128,9 +134,6 @@ public class {{classname}} { return {{localVariablePrefix}}apiClient.buildCall({{localVariablePrefix}}localVarPath, "{{httpMethod}}", {{localVariablePrefix}}localVarQueryParams, {{localVariablePrefix}}localVarCollectionQueryParams, {{localVariablePrefix}}localVarPostBody, {{localVariablePrefix}}localVarHeaderParams, {{localVariablePrefix}}localVarFormParams, {{localVariablePrefix}}localVarAuthNames, progressRequestListener); } - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} @SuppressWarnings("rawtypes") private okhttp3.Call {{operationId}}ValidateBeforeCall({{#parameters}}{{{dataType}}} {{paramName}}, {{/parameters}}final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { {{^performBeanValidation}} @@ -179,11 +182,17 @@ public class {{classname}} { * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/parameters}}{{#returnType}} * @return {{returnType}}{{/returnType}} * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - {{#externalDocs}} + {{#vendorExtensions.x-is-deprecated}} + * @deprecated + {{/vendorExtensions.x-is-deprecated}} + {{#externalDocs}} * {{description}} * @see {{summary}} Documentation - {{/externalDocs}} + {{/externalDocs}} */ + {{#vendorExtensions.x-is-deprecated}} + @Deprecated + {{/vendorExtensions.x-is-deprecated}} public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#parameters}}{{{dataType}}} {{paramName}}{{#has this 'more'}}, {{/has}}{{/parameters}}) throws ApiException { {{#returnType}}ApiResponse<{{{returnType}}}> {{localVariablePrefix}}resp = {{/returnType}}{{operationId}}WithHttpInfo({{#parameters}}{{paramName}}{{#has this 'more'}}, {{/has}}{{/parameters}});{{#returnType}} return {{localVariablePrefix}}resp.getData();{{/returnType}} @@ -195,11 +204,17 @@ public class {{classname}} { * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/parameters}} * @return ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - {{#externalDocs}} + {{#vendorExtensions.x-is-deprecated}} + * @deprecated + {{/vendorExtensions.x-is-deprecated}} + {{#externalDocs}} * {{description}} * @see {{summary}} Documentation - {{/externalDocs}} + {{/externalDocs}} */ + {{#vendorExtensions.x-is-deprecated}} + @Deprecated + {{/vendorExtensions.x-is-deprecated}} public ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#parameters}}{{#if useBeanValidation}}{{>beanValidationQueryParams}}{{/if}}{{{dataType}}} {{paramName}}{{#has this 'more'}}, {{/has}}{{/parameters}}) throws ApiException { okhttp3.Call {{localVariablePrefix}}call = {{operationId}}ValidateBeforeCall({{#parameters}}{{paramName}}, {{/parameters}}null, null); {{#returnType}}Type {{localVariablePrefix}}localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); @@ -213,11 +228,17 @@ public class {{classname}} { * @param callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object - {{#externalDocs}} + {{#vendorExtensions.x-is-deprecated}} + * @deprecated + {{/vendorExtensions.x-is-deprecated}} + {{#externalDocs}} * {{description}} * @see {{summary}} Documentation - {{/externalDocs}} + {{/externalDocs}} */ + {{#vendorExtensions.x-is-deprecated}} + @Deprecated + {{/vendorExtensions.x-is-deprecated}} public okhttp3.Call {{operationId}}Async({{#parameters}}{{{dataType}}} {{paramName}}, {{/parameters}}final ApiCallback<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{localVariablePrefix}}callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; diff --git a/src/main/resources/handlebars/Java/libraries/resteasy/api.mustache b/src/main/resources/handlebars/Java/libraries/resteasy/api.mustache index dc82c09647..6968fc1914 100644 --- a/src/main/resources/handlebars/Java/libraries/resteasy/api.mustache +++ b/src/main/resources/handlebars/Java/libraries/resteasy/api.mustache @@ -51,17 +51,17 @@ public class {{classname}} { * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/parameters}}{{#returnType}} * @return {{{returnType}}}{{/returnType}} * @throws ApiException if fails to make API call - {{#isDeprecated}} + {{#vendorExtension.x-is-enum}} * @deprecated - {{/isDeprecated}} + {{/vendorExtension.x-is-enum}} {{#externalDocs}} * {{description}} * @see {{summary}} Documentation {{/externalDocs}} */ - {{#isDeprecated}} + {{#vendorExtension.x-is-enum}} @Deprecated - {{/isDeprecated}} + {{/vendorExtension.x-is-enum}} public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#parameters}}{{{dataType}}} {{paramName}}{{#has this 'more'}}, {{/has}}{{/parameters}}) throws ApiException { Object {{localVariablePrefix}}localVarPostBody = {{^isForm}}{{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}{{/isForm}}{{#isForm}}null{{/isForm}}; {{#parameters}}{{#required}} diff --git a/src/main/resources/handlebars/Java/libraries/resttemplate/api.mustache b/src/main/resources/handlebars/Java/libraries/resttemplate/api.mustache index c4b64f5b75..934feca699 100644 --- a/src/main/resources/handlebars/Java/libraries/resttemplate/api.mustache +++ b/src/main/resources/handlebars/Java/libraries/resttemplate/api.mustache @@ -63,14 +63,17 @@ public class {{classname}} { * @return {{returnType}} {{/returnType}} * @throws RestClientException if an error occurs while attempting to invoke the API + {{#vendorExtensions.x-is-deprecated}} + * @deprecated + {{/vendorExtensions.x-is-deprecated}} {{#externalDocs}} * {{description}} * @see {{summary}} Documentation {{/externalDocs}} */ - {{#isDeprecated}} + {{#vendorExtension.x-is-enum}} @Deprecated - {{/isDeprecated}} + {{/vendorExtension.x-is-enum}} public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#parameters}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/parameters}}) throws RestClientException { {{#returnType}} return {{operationId}}WithHttpInfo({{#parameters}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/parameters}}).getBody(); @@ -91,14 +94,17 @@ public class {{classname}} { {{/parameters}} * @return ResponseEntity<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> * @throws RestClientException if an error occurs while attempting to invoke the API + {{#vendorExtensions.x-is-deprecated}} + * @deprecated + {{/vendorExtensions.x-is-deprecated}} {{#externalDocs}} * {{description}} * @see {{summary}} Documentation {{/externalDocs}} */ - {{#isDeprecated}} + {{#vendorExtension.x-is-enum}} @Deprecated - {{/isDeprecated}} + {{/vendorExtension.x-is-enum}} public ResponseEntity<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#parameters}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/parameters}}) throws RestClientException { Object {{localVariablePrefix}}postBody = {{^isForm}}{{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}{{/isForm}}{{#isForm}}null{{/isForm}}; {{#parameters}} diff --git a/src/main/resources/handlebars/Java/libraries/retrofit/api.mustache b/src/main/resources/handlebars/Java/libraries/retrofit/api.mustache index 67b4a37f5f..6df6a2f83c 100644 --- a/src/main/resources/handlebars/Java/libraries/retrofit/api.mustache +++ b/src/main/resources/handlebars/Java/libraries/retrofit/api.mustache @@ -56,6 +56,9 @@ public interface {{classname}} { * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/parameters}} * @param cb callback method +{{#vendorExtensions.x-is-deprecated}} + * @deprecated +{{/vendorExtensions.x-is-deprecated}} {{#externalDocs}} * {{description}} * @see {{summary}} Documentation @@ -72,6 +75,9 @@ public interface {{classname}} { {{/@first}} {{/formParams}} @{{httpMethod}}("{{{path}}}") + {{#vendorExtensions.x-is-deprecated}} + @Deprecated + {{/vendorExtensions.x-is-deprecated}} void {{operationId}}( {{#parameters}}{{>libraries/retrofit/queryParams}}{{>libraries/retrofit/pathParams}}{{>libraries/retrofit/headerParams}}{{>libraries/retrofit/bodyParams}}{{>libraries/retrofit/formParams}}{{>libraries/retrofit/cookieParams}}, {{/parameters}}Callback<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Object{{/returnType}}> cb ); From 990f9abfffa010019c0519e21258be0547814fc8 Mon Sep 17 00:00:00 2001 From: Michael Mutin Date: Tue, 25 Jun 2024 10:09:41 +0200 Subject: [PATCH 2/2] [Java][Client] Add Deprecation annotation for retrofit2 --- .../handlebars/Java/libraries/retrofit2/api.mustache | 6 ++++++ .../handlebars/Java/libraries/retrofit2/play24/api.mustache | 6 ++++++ .../handlebars/Java/libraries/retrofit2/play25/api.mustache | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/src/main/resources/handlebars/Java/libraries/retrofit2/api.mustache b/src/main/resources/handlebars/Java/libraries/retrofit2/api.mustache index 2d9dfc3517..ea660ba14c 100644 --- a/src/main/resources/handlebars/Java/libraries/retrofit2/api.mustache +++ b/src/main/resources/handlebars/Java/libraries/retrofit2/api.mustache @@ -40,11 +40,17 @@ public interface {{classname}} { * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/parameters}} * @return Call<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object{{/returnType}}> +{{#vendorExtensions.x-is-deprecated}} + * @deprecated +{{/vendorExtensions.x-is-deprecated}} {{#externalDocs}} * {{description}} * @see {{summary}} Documentation {{/externalDocs}} */ + {{#vendorExtensions.x-is-deprecated}} + @Deprecated + {{/vendorExtensions.x-is-deprecated}} {{#formParams}} {{#@first}} {{#is ../this 'multipart'}}@retrofit2.http.Multipart{{/is}}{{#isNot ../this 'multipart'}}@retrofit2.http.FormUrlEncoded{{/isNot}} diff --git a/src/main/resources/handlebars/Java/libraries/retrofit2/play24/api.mustache b/src/main/resources/handlebars/Java/libraries/retrofit2/play24/api.mustache index 2f968ee56c..b321c29565 100644 --- a/src/main/resources/handlebars/Java/libraries/retrofit2/play24/api.mustache +++ b/src/main/resources/handlebars/Java/libraries/retrofit2/play24/api.mustache @@ -33,7 +33,13 @@ public interface {{classname}} { * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/parameters}} * @return Call<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Object{{/returnType}}> +{{#vendorExtensions.x-is-deprecated}} + * @deprecated +{{/vendorExtensions.x-is-deprecated}} */ + {{#vendorExtensions.x-is-deprecated}} + @Deprecated + {{/vendorExtensions.x-is-deprecated}} {{#formParams}} {{#@first}} {{#isMultipart}}@retrofit2.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit2.http.FormUrlEncoded{{/isMultipart}} diff --git a/src/main/resources/handlebars/Java/libraries/retrofit2/play25/api.mustache b/src/main/resources/handlebars/Java/libraries/retrofit2/play25/api.mustache index 0e61b74cc6..9161ad12f4 100644 --- a/src/main/resources/handlebars/Java/libraries/retrofit2/play25/api.mustache +++ b/src/main/resources/handlebars/Java/libraries/retrofit2/play25/api.mustache @@ -33,7 +33,13 @@ public interface {{classname}} { * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/parameters}} * @return Call<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> +{{#vendorExtensions.x-is-deprecated}} + * @deprecated +{{/vendorExtensions.x-is-deprecated}} */ + {{#vendorExtensions.x-is-deprecated}} + @Deprecated + {{/vendorExtensions.x-is-deprecated}} {{#formParams}} {{#@first}} {{#isMultipart}}@retrofit2.http.Multipart{{/isMultipart}}{{^isMultipart}}@retrofit2.http.FormUrlEncoded{{/isMultipart}}