From 495971c2c79190b050b132dc9efa99bc47d94383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Bresson?= Date: Sun, 20 May 2018 08:55:56 +0200 Subject: [PATCH] [Java] use html entities in javadoc of generated code (#106) --- .../src/main/resources/Java/api.mustache | 2 +- .../resources/Java/libraries/feign/api.mustache | 6 +++--- .../resources/Java/libraries/jersey2/api.mustache | 4 ++-- .../Java/libraries/okhttp-gson/api.mustache | 8 ++++---- .../Java/libraries/rest-assured/api.mustache | 14 +++++++------- .../resources/Java/libraries/resteasy/api.mustache | 2 +- .../resources/Java/libraries/retrofit/api.mustache | 4 ++-- .../Java/libraries/retrofit2/api.mustache | 2 +- .../Java/libraries/retrofit2/play24/api.mustache | 2 +- .../Java/libraries/retrofit2/play25/api.mustache | 2 +- .../Java/libraries/vertx/apiImpl.mustache | 2 +- .../Java/libraries/vertx/rxApiImpl.mustache | 4 ++-- .../templates/Java/libraries/jersey2/api.mustache | 2 +- 13 files changed, 27 insertions(+), 27 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/api.mustache b/modules/openapi-generator/src/main/resources/Java/api.mustache index 542ccbba287c..17f8d56ac6e7 100644 --- a/modules/openapi-generator/src/main/resources/Java/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/api.mustache @@ -46,7 +46,7 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} {{#returnType}} * @return {{returnType}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache index 03eb7dd40cb9..dea8a6e8aef6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/api.mustache @@ -25,7 +25,7 @@ public interface {{classname}} extends ApiClient.Api { * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} {{#returnType}} * @return {{returnType}} @@ -55,14 +55,14 @@ public interface {{classname}} extends ApiClient.Api { * building up this map in a fluent style. {{#allParams}} {{^isQueryParam}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/isQueryParam}} {{/allParams}} * @param queryParams Map of query parameters as name-value pairs *

The following elements may be specified in the query map:

* {{#returnType}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache index fed034609c89..ad7d43d61132 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/api.mustache @@ -44,7 +44,7 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} {{#returnType}} * @return {{returnType}} @@ -73,7 +73,7 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} {{#returnType}} * @return ApiResponse<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache index ffc68bc7b5a6..0ef776280fda 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/api.mustache @@ -65,7 +65,7 @@ public class {{classname}} { {{#operation}} /** * Build call for {{operationId}}{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{/allParams}} * @param progressListener Progress listener * @param progressRequestListener Progress request listener * @return Call to execute @@ -177,7 +177,7 @@ public class {{classname}} { /** * {{summary}} * {{notes}}{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}}{{#returnType}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{/allParams}}{{#returnType}} * @return {{returnType}}{{/returnType}} * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body {{#isDeprecated}} @@ -199,7 +199,7 @@ public class {{classname}} { /** * {{summary}} * {{notes}}{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{/allParams}} * @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 {{#isDeprecated}} @@ -222,7 +222,7 @@ public class {{classname}} { /** * {{summary}} (asynchronously) * {{notes}}{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{/allParams}} * @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 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache index cd481e61af90..0263f6cf323a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/api.mustache @@ -67,7 +67,7 @@ public class {{classname}} { * {{notes}} * {{#allParams}} - * @see #{{#isPathParam}}{{paramName}}Path{{/isPathParam}}{{#isQueryParam}}{{paramName}}Query{{/isQueryParam}}{{#isFormParam}}{{^isFile}}{{paramName}}Form{{/isFile}}{{#isFile}}{{paramName}}MultiPart{{/isFile}}{{/isFormParam}}{{#isHeaderParam}}{{paramName}}Header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @see #{{#isPathParam}}{{paramName}}Path{{/isPathParam}}{{#isQueryParam}}{{paramName}}Query{{/isQueryParam}}{{#isFormParam}}{{^isFile}}{{paramName}}Form{{/isFile}}{{#isFile}}{{paramName}}MultiPart{{/isFile}}{{/isFormParam}}{{#isHeaderParam}}{{paramName}}Header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} {{#returnType}} * return {{returnType}} @@ -141,7 +141,7 @@ public class {{classname}} { {{#bodyParams}} /** - * @param {{paramName}} ({{dataType}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{paramName}} ({{dataType}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} * @return operation */ public {{operationIdCamelCase}}Oper body({{{dataType}}} {{paramName}}) { @@ -154,7 +154,7 @@ public class {{classname}} { public static final String {{#convert}}{{paramName}}{{/convert}}_HEADER = "{{baseName}}"; /** - * @param {{paramName}} ({{dataType}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{paramName}} ({{dataType}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} * @return operation */ public {{operationIdCamelCase}}Oper {{paramName}}Header(String {{paramName}}) { @@ -167,7 +167,7 @@ public class {{classname}} { public static final String {{#convert}}{{paramName}}{{/convert}}_PATH = "{{baseName}}"; /** - * @param {{paramName}} ({{dataType}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{paramName}} ({{dataType}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} * @return operation */ public {{operationIdCamelCase}}Oper {{paramName}}Path(Object {{paramName}}) { @@ -180,7 +180,7 @@ public class {{classname}} { public static final String {{#convert}}{{paramName}}{{/convert}}_QUERY = "{{baseName}}"; /** - * @param {{paramName}} ({{dataType}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{paramName}} ({{dataType}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} * @return operation */ public {{operationIdCamelCase}}Oper {{paramName}}Query(Object... {{paramName}}) { @@ -194,7 +194,7 @@ public class {{classname}} { public static final String {{#convert}}{{paramName}}{{/convert}}_FORM = "{{baseName}}"; /** - * @param {{paramName}} ({{dataType}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{paramName}} ({{dataType}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} * @return operation */ public {{operationIdCamelCase}}Oper {{paramName}}Form(Object... {{paramName}}) { @@ -209,7 +209,7 @@ public class {{classname}} { /** * It will assume that the control name is file and the <content-type> is <application/octet-stream> * @see #reqSpec for customise - * @param {{paramName}} ({{dataType}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{paramName}} ({{dataType}}) {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} * @return operation */ public {{operationIdCamelCase}}Oper {{paramName}}MultiPart({{{dataType}}} {{paramName}}) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/api.mustache index f3fd01ed61b1..9e6fa4e1364c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/api.mustache @@ -42,7 +42,7 @@ public class {{classname}} { /** * {{summary}} * {{notes}}{{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}}{{#returnType}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}}{{/allParams}}{{#returnType}} * @return {{{returnType}}}{{/returnType}} * @throws ApiException if fails to make API call {{#isDeprecated}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api.mustache index 46df0ecedf3f..9effc0560569 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit/api.mustache @@ -24,7 +24,7 @@ public interface {{classname}} { * Sync method * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} * @return {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}} {{#externalDocs}} @@ -43,7 +43,7 @@ public interface {{classname}} { * {{summary}} * Async method {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} * @param cb callback method {{#externalDocs}} 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 f6eb4c2dd07d..44f33a514f85 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 @@ -39,7 +39,7 @@ public interface {{classname}} { * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} * @return {{^doNotUseRx}}{{#useRxJava}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/useRxJava}}{{#useRxJava2}}{{#returnType}}Observable<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{returnType}}{{/isResponseFile}}>{{/returnType}}{{^returnType}}Completable{{/returnType}}{{/useRxJava2}}{{/doNotUseRx}}{{#doNotUseRx}}Call<{{#isResponseFile}}ResponseBody{{/isResponseFile}}{{^isResponseFile}}{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}{{/isResponseFile}}>{{/doNotUseRx}} {{#isDeprecated}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/api.mustache index 9d43d64d78a9..dd6bf23e9475 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play24/api.mustache @@ -31,7 +31,7 @@ public interface {{classname}} { * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} * @return Call<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> */ diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/api.mustache index 32de090e435c..b435a16c0515 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/play25/api.mustache @@ -31,7 +31,7 @@ public interface {{classname}} { * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} * @return Call<{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}Void{{/returnType}}> */ diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/apiImpl.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/apiImpl.mustache index f4b5a7239225..37893a8888f9 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/apiImpl.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/apiImpl.mustache @@ -44,7 +44,7 @@ public class {{classname}}Impl implements {{classname}} { * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} * @param resultHandler Asynchronous result handler */ diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/rxApiImpl.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/rxApiImpl.mustache index 09ca96895d6e..be144ff3eaaa 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/rxApiImpl.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/rxApiImpl.mustache @@ -28,7 +28,7 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} * @param resultHandler Asynchronous result handler */ @@ -40,7 +40,7 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} * @return Asynchronous result handler (RxJava Single) */ diff --git a/modules/openapi-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/api.mustache b/modules/openapi-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/api.mustache index 85cd2b5f714f..e448729450da 100644 --- a/modules/openapi-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/api.mustache +++ b/modules/openapi-generator/src/test/resources/2_0/templates/Java/libraries/jersey2/api.mustache @@ -45,7 +45,7 @@ public class {{classname}} { * {{summary}} * {{notes}} {{#allParams}} - * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{paramName}} {{description}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} {{#returnType}} * @return {{returnType}}