From 7b8b7410efbd9a2c510881e3bf2d0e73bb48082e Mon Sep 17 00:00:00 2001 From: Hugo Mercado Date: Mon, 15 May 2023 11:50:11 -0500 Subject: [PATCH 1/9] fixed outer enum errors for jaxrs-resteasy generator --- .../resteasy/enumOuterClass.mustache | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/enumOuterClass.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/enumOuterClass.mustache index fd5a5a3f5f..8b6b0b1127 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/enumOuterClass.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/enumOuterClass.mustache @@ -1,3 +1,23 @@ -public enum {{classname}} { - {{#allowableValues}}{{.}}{{^@last}}, {{/@last}}{{/allowableValues}} +/** o.O +* {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} +*/ +public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { + {{#allowableValues}} + {{#enumVars}} + {{{name}}}({{#value}}{{{value}}}{{/value}}{{^value}}null{{/value}}){{^@last}}, +{{/@last}}{{#@last}}; + {{/@last}} + {{/enumVars}} + {{/allowableValues}} + private {{dataType}} value; + + {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}({{dataType}} value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } } \ No newline at end of file From 6f8e3392a40c8d505dd80677e90ccfe95195bc30 Mon Sep 17 00:00:00 2001 From: Hugo Mercado Date: Mon, 15 May 2023 12:20:52 -0500 Subject: [PATCH 2/9] fixed map import for api and model templates in jaxrs-resteasy generator --- .../resources/handlebars/JavaJaxRS/resteasy/apiService.mustache | 1 + .../handlebars/JavaJaxRS/resteasy/apiServiceImpl.mustache | 1 + src/main/resources/handlebars/JavaJaxRS/resteasy/model.mustache | 1 + 3 files changed, 3 insertions(+) diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/apiService.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/apiService.mustache index 9ccd249952..553d5ff846 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/apiService.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/apiService.mustache @@ -9,6 +9,7 @@ import {{package}}.*; {{/imports}} import java.util.List; +import java.util.Map; import {{package}}.NotFoundException; import java.io.InputStream; diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/apiServiceImpl.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/apiServiceImpl.mustache index 040406a8db..0a3fe5a04c 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/apiServiceImpl.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/apiServiceImpl.mustache @@ -9,6 +9,7 @@ import {{package}}.*; {{/imports}} import java.util.List; +import java.util.Map; import {{package}}.NotFoundException; import java.io.InputStream; diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/model.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/model.mustache index 5efaee7d00..8c70a27988 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/model.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/model.mustache @@ -3,6 +3,7 @@ package {{package}}; {{^x-is-composed-model}} import java.util.Objects; import java.util.ArrayList; +import java.util.HashMap; {{#imports}}import {{import}}; {{/imports}} {{#serializableModel}} From 55a0d269f13b6b7b8ed83aa4760677e61956f7dc Mon Sep 17 00:00:00 2001 From: Hugo Mercado Date: Mon, 15 May 2023 12:24:10 -0500 Subject: [PATCH 3/9] updated jaxrs-resteasy version to support patch annotation --- .../handlebars/JavaJaxRS/resteasy/gradle.mustache | 8 ++++---- .../resources/handlebars/JavaJaxRS/resteasy/pom.mustache | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/gradle.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/gradle.mustache index a2f37b6e42..8a02257f2b 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/gradle.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/gradle.mustache @@ -8,10 +8,10 @@ repositories { } dependencies { - providedCompile 'org.jboss.resteasy:resteasy-jaxrs:3.0.11.Final' - providedCompile 'org.jboss.resteasy:jaxrs-api:3.0.11.Final' + providedCompile 'org.jboss.resteasy:resteasy-jaxrs:3.15.6.Final' + providedCompile 'org.jboss.resteasy:jaxrs-api:3.0.12.Final' providedCompile 'org.jboss.resteasy:resteasy-validator-provider-11:3.0.11.Final' - providedCompile 'org.jboss.resteasy:resteasy-multipart-provider:3.0.11.Final' + providedCompile 'org.jboss.resteasy:resteasy-multipart-provider:3.15.6.Final' providedCompile 'jakarta.annotation:jakarta.annotation-api:{{#jakarta}}2.1.1{{/jakarta}}{{^jakarta}}1.3.5{{/jakarta}}' providedCompile 'javax:javaee-api:7.0' providedCompile 'org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:1.0.0.Final' @@ -21,7 +21,7 @@ dependencies { {{^useOas2}} compile 'io.swagger.core.v3:swagger-annotations:2.0.0' {{/useOas2}} - compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' + compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.15.6.Final' compile 'org.apache.httpcomponents:httpclient:4.5.10' {{#useBeanValidation}} providedCompile 'jakarta.validation:jakarta.validation-api:{{#jakarta}}3.0.2{{/jakarta}}{{^jakarta}}2.0.2{{/jakarta}}' diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/pom.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/pom.mustache index 7cd664ae2e..8d52ff3998 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/pom.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/pom.mustache @@ -120,12 +120,12 @@ org.jboss.resteasy jaxrs-api - ${resteasy-version} + 3.0.12.Final org.jboss.resteasy resteasy-validator-provider-11 - ${resteasy-version} + 3.6.3.Final provided @@ -259,7 +259,7 @@ 2.0.9 {{/useOas2}} 9.3.27.v20190418 - 3.0.11.Final + 3.15.6.Final 1.6.3 4.13.1 {{#jakarta}}6.0.0{{/jakarta}}{{^jakarta}}2.5{{/jakarta}} From a3370876a8f55e8a32c2e8a30c55ccbcb4a98eaa Mon Sep 17 00:00:00 2001 From: Hugo Mercado Date: Mon, 15 May 2023 12:24:52 -0500 Subject: [PATCH 4/9] removed invalid "defaultValue" property from @Parameter annotation --- .../resources/handlebars/JavaJaxRS/resteasy/bodyParams.mustache | 2 +- .../handlebars/JavaJaxRS/resteasy/eap/bodyParams.mustache | 2 +- .../handlebars/JavaJaxRS/resteasy/eap/formParams.mustache | 2 +- .../handlebars/JavaJaxRS/resteasy/eap/headerParams.mustache | 2 +- .../resources/handlebars/JavaJaxRS/resteasy/formParams.mustache | 2 +- .../handlebars/JavaJaxRS/resteasy/headerParams.mustache | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/bodyParams.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/bodyParams.mustache index 3d22f0b06b..d9250c7e56 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/bodyParams.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/bodyParams.mustache @@ -1 +1 @@ -{{#is this 'body-param'}}{{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/useOas2}}{{^useOas2}}@Parameter(description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/useOas2}}{{/is}} \ No newline at end of file +{{#is this 'body-param'}}{{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/useOas2}}{{^useOas2}}@Parameter(description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}) {{{dataType}}} {{paramName}}{{/useOas2}}{{/is}} \ No newline at end of file diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/bodyParams.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/bodyParams.mustache index 3d22f0b06b..d9250c7e56 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/bodyParams.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/bodyParams.mustache @@ -1 +1 @@ -{{#is this 'body-param'}}{{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/useOas2}}{{^useOas2}}@Parameter(description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/useOas2}}{{/is}} \ No newline at end of file +{{#is this 'body-param'}}{{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/useOas2}}{{^useOas2}}@Parameter(description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}) {{{dataType}}} {{paramName}}{{/useOas2}}{{/is}} \ No newline at end of file diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/formParams.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/formParams.mustache index bca3affc3d..52ddceda5d 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/formParams.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/formParams.mustache @@ -1 +1 @@ -{{#is this 'form-param'}}{{#isNot this 'binary'}}{{#useOas2}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{^useOas2}}@Parameter(description = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{/isNot}}{{/is}} \ No newline at end of file +{{#is this 'form-param'}}{{#isNot this 'binary'}}{{#useOas2}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{^useOas2}}@Parameter(description = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}})@FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{/isNot}}{{/is}} \ No newline at end of file diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/headerParams.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/headerParams.mustache index 7b9d478841..2df32600fa 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/headerParams.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/headerParams.mustache @@ -1 +1 @@ -{{#is this 'header-param'}}{{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{^useOas2}}@Parameter(description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{/is}} \ No newline at end of file +{{#is this 'header-param'}}{{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{^useOas2}}@Parameter(description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{/is}} \ No newline at end of file diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/formParams.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/formParams.mustache index bca3affc3d..52ddceda5d 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/formParams.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/formParams.mustache @@ -1 +1 @@ -{{#is this 'form-param'}}{{#isNot this 'binary'}}{{#useOas2}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{^useOas2}}@Parameter(description = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{/isNot}}{{/is}} \ No newline at end of file +{{#is this 'form-param'}}{{#isNot this 'binary'}}{{#useOas2}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{^useOas2}}@Parameter(description = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}})@FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{/isNot}}{{/is}} \ No newline at end of file diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/headerParams.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/headerParams.mustache index 7b9d478841..2df32600fa 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/headerParams.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/headerParams.mustache @@ -1 +1 @@ -{{#is this 'header-param'}}{{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{^useOas2}}@Parameter(description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{/is}} \ No newline at end of file +{{#is this 'header-param'}}{{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{^useOas2}}@Parameter(description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}})@HeaderParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/useOas2}}{{/is}} \ No newline at end of file From 4247081edea119d1f24e23a2973315057a5b991c Mon Sep 17 00:00:00 2001 From: Hugo Mercado Date: Tue, 16 May 2023 01:11:59 -0500 Subject: [PATCH 5/9] updated jaxrs-resteasy templates to fix build issues --- .../resources/handlebars/JavaJaxRS/resteasy/api.mustache | 4 ++-- .../handlebars/JavaJaxRS/resteasy/apiService.mustache | 3 +-- .../handlebars/JavaJaxRS/resteasy/apiServiceImpl.mustache | 2 +- .../handlebars/JavaJaxRS/resteasy/bodyParams.mustache | 5 ++++- .../resources/handlebars/JavaJaxRS/resteasy/comma.mustache | 1 + .../handlebars/JavaJaxRS/resteasy/cookieParams.mustache | 4 ++++ .../JavaJaxRS/resteasy/serviceCookieParams.mustache | 1 + .../handlebars/JavaJaxRS/resteasy/serviceFormParams.mustache | 2 +- .../handlebars/JavaJaxRS/serviceFormParams.mustache | 2 +- 9 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 src/main/resources/handlebars/JavaJaxRS/resteasy/comma.mustache create mode 100644 src/main/resources/handlebars/JavaJaxRS/resteasy/cookieParams.mustache create mode 100644 src/main/resources/handlebars/JavaJaxRS/resteasy/serviceCookieParams.mustache diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/api.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/api.mustache index 2154dffa6d..63df307143 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/api.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/api.mustache @@ -100,9 +100,9 @@ public class {{classname}} { @ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}"{{^vendorExtensions.x-java-is-response-void}}, content = @Content({{#schema.extensions.x-content-type}}mediaType = "{{schema.extensions.x-content-type}}", {{/schema.extensions.x-content-type}}{{^containerType}}schema = @Schema(implementation = {{{baseType}}}.class)){{/containerType}}{{#containerType}}array = @ArraySchema(schema = @Schema(implementation = {{{baseType}}}.class))){{/containerType}}{{/vendorExtensions.x-java-is-response-void}}){{#hasMore}}, {{/hasMore}}{{/responses}} }) {{/useOas2}} - public Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#parameters}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{^isMultipart}}{{>formParams}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}},{{/isFormParam}}{{/isMultipart}}{{/parameters}}@Context SecurityContext securityContext) + public Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#parameters}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{>comma}}{{/parameters}}@Context SecurityContext securityContext) throws NotFoundException { - return service.{{nickname}}({{#isMultipart}}input,{{/isMultipart}}{{#parameters}}{{^isMultipart}}{{paramName}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}}{{paramName}},{{/isFormParam}}{{/isMultipart}}{{/parameters}}securityContext); + return service.{{nickname}}({{#isMultipart}}input,{{/isMultipart}}{{#parameters}}{{^isFormParam}}{{paramName}}{{/isFormParam}}{{#isFormParam}}{{^isBinary}}{{paramName}}{{/isBinary}}{{/isFormParam}}{{>comma}}{{/parameters}}securityContext); } {{/contents}} {{/operation}} diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/apiService.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/apiService.mustache index 553d5ff846..1fe2bf110c 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/apiService.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/apiService.mustache @@ -28,8 +28,7 @@ import javax.ws.rs.core.SecurityContext; public interface {{classname}}Service { {{#operation}} {{#contents}} - Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#parameters}}{{>serviceQueryParams}}{{>servicePathParams}}{{>serviceHeaderParams}}{{>serviceBodyParams}}{{^isMultipart}}{{>serviceFormParams}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}},{{/isFormParam}}{{/isMultipart}}{{/parameters}}SecurityContext securityContext) - throws NotFoundException; + Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#parameters}}{{>serviceQueryParams}}{{>serviceCookieParams}}{{>servicePathParams}}{{>serviceHeaderParams}}{{>serviceBodyParams}}{{>serviceFormParams}}{{>comma}}{{/parameters}}SecurityContext securityContext) throws NotFoundException; {{/contents}} {{/operation}} } diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/apiServiceImpl.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/apiServiceImpl.mustache index 0a3fe5a04c..379ff2bf0e 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/apiServiceImpl.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/apiServiceImpl.mustache @@ -31,7 +31,7 @@ import javax.ws.rs.core.SecurityContext; public class {{classname}}ServiceImpl implements {{classname}}Service { {{#operation}} {{#contents}} - public Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#parameters}}{{>serviceQueryParams}}{{>servicePathParams}}{{>serviceHeaderParams}}{{>serviceBodyParams}}{{^isMultipart}}{{>serviceFormParams}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}},{{/isFormParam}}{{/isMultipart}}{{/parameters}}SecurityContext securityContext) + public Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#parameters}}{{>serviceQueryParams}}{{>servicePathParams}}{{>serviceHeaderParams}}{{>serviceBodyParams}}{{>serviceFormParams}}{{>serviceCookieParams}}{{>comma}}{{/parameters}}SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/bodyParams.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/bodyParams.mustache index d9250c7e56..9ad8f3307e 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/bodyParams.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/bodyParams.mustache @@ -1 +1,4 @@ -{{#is this 'body-param'}}{{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/useOas2}}{{^useOas2}}@Parameter(description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}) {{{dataType}}} {{paramName}}{{/useOas2}}{{/is}} \ No newline at end of file +{{#is this 'body-param'}} +{{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/useOas2}} +{{^useOas2}}@Parameter(description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}) {{{dataType}}} {{paramName}}{{/useOas2}} +{{/is}} \ No newline at end of file diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/comma.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/comma.mustache new file mode 100644 index 0000000000..5d8c1f9602 --- /dev/null +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/comma.mustache @@ -0,0 +1 @@ +{{^isFormParam}},{{/isFormParam}}{{#isFormParam}}{{^isBinary}},{{/isBinary}}{{/isFormParam}} \ No newline at end of file diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/cookieParams.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/cookieParams.mustache new file mode 100644 index 0000000000..c8dae79c63 --- /dev/null +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/cookieParams.mustache @@ -0,0 +1,4 @@ +{{#isCookieParam}} +{{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/useOas2}} +{{^useOas2}}@Parameter(description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}) {{{dataType}}} {{paramName}}{{/useOas2}} +{{/isCookieParam}} diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/serviceCookieParams.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/serviceCookieParams.mustache new file mode 100644 index 0000000000..70871f0f8c --- /dev/null +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/serviceCookieParams.mustache @@ -0,0 +1 @@ +{{#isCookieParam}}{{{dataType}}} {{paramName}}{{/isCookieParam}} \ No newline at end of file diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/serviceFormParams.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/serviceFormParams.mustache index 72fe3e7ebe..610b6059ac 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/serviceFormParams.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/serviceFormParams.mustache @@ -1 +1 @@ -{{#is this 'form-param'}}{{#isNot this 'binary'}}{{{dataType}}} {{paramName}}{{/isNot}}{{#is this 'binary'}}FormDataContentDisposition fileDetail{{/is}}{{/is}} \ No newline at end of file +{{#isFormParam}}{{^isBinary}}{{{dataType}}} {{paramName}}{{/isBinary}}{{/isFormParam}} \ No newline at end of file diff --git a/src/main/resources/handlebars/JavaJaxRS/serviceFormParams.mustache b/src/main/resources/handlebars/JavaJaxRS/serviceFormParams.mustache index 06e6c0d0fd..610b6059ac 100644 --- a/src/main/resources/handlebars/JavaJaxRS/serviceFormParams.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/serviceFormParams.mustache @@ -1 +1 @@ -{{#is this 'form-param'}}{{#isNot this 'binary'}}{{{dataType}}} {{paramName}}{{/isNot}}{{#is this 'binary'}}InputStream {{paramName}}InputStream, FormDataContentDisposition {{paramName}}Detail{{/is}}{{/is}} \ No newline at end of file +{{#isFormParam}}{{^isBinary}}{{{dataType}}} {{paramName}}{{/isBinary}}{{/isFormParam}} \ No newline at end of file From c2deee9223a492ce1508c0ae97464128f2e9d833 Mon Sep 17 00:00:00 2001 From: Hugo Mercado Date: Tue, 16 May 2023 02:08:27 -0500 Subject: [PATCH 6/9] updated jaxrs-resteasy-eap template to fix. build errors --- .../handlebars/JavaJaxRS/resteasy/eap/api.mustache | 2 +- .../JavaJaxRS/resteasy/eap/apiServiceImpl.mustache | 3 ++- .../handlebars/JavaJaxRS/resteasy/eap/comma.mustache | 1 + .../JavaJaxRS/resteasy/eap/cookieParams.mustache | 4 ++++ .../handlebars/JavaJaxRS/resteasy/eap/model.mustache | 1 + .../handlebars/JavaJaxRS/resteasy/eap/pom.mustache | 8 ++++---- .../JavaJaxRS/resteasy/eap/serviceCookieParams.mustache | 1 + .../JavaJaxRS/resteasy/eap/serviceFormParams.mustache | 2 +- 8 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 src/main/resources/handlebars/JavaJaxRS/resteasy/eap/comma.mustache create mode 100644 src/main/resources/handlebars/JavaJaxRS/resteasy/eap/cookieParams.mustache create mode 100644 src/main/resources/handlebars/JavaJaxRS/resteasy/eap/serviceCookieParams.mustache diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/api.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/api.mustache index 0bb116e491..a0a6c30bad 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/api.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/api.mustache @@ -93,7 +93,7 @@ public interface {{classname}} { @ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}"{{^vendorExtensions.x-java-is-response-void}}, content = @Content({{#schema.extensions.x-content-type}}mediaType = "{{schema.extensions.x-content-type}}", {{/schema.extensions.x-content-type}}{{^containerType}}schema = @Schema(implementation = {{{baseType}}}.class)){{/containerType}}{{#containerType}}array = @ArraySchema(schema = @Schema(implementation = {{{baseType}}}.class))){{/containerType}}{{/vendorExtensions.x-java-is-response-void}}){{#hasMore}},{{/hasMore}} {{/responses}} }) {{/useOas2}} - Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#parameters}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{^isMultipart}}{{>formParams}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}},{{/isFormParam}}{{/isMultipart}}{{/parameters}}@Context SecurityContext securityContext); + Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#parameters}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{>comma}}{{/parameters}}@Context SecurityContext securityContext); {{/contents}} {{/operation}} diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/apiServiceImpl.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/apiServiceImpl.mustache index 29558d2992..eeae9022e1 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/apiServiceImpl.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/apiServiceImpl.mustache @@ -9,6 +9,7 @@ import {{package}}.*; {{/imports}} import java.util.List; +import java.util.Map; import java.io.InputStream; @@ -26,7 +27,7 @@ import javax.ws.rs.core.SecurityContext; public class {{classname}}ServiceImpl implements {{classname}} { {{#operation}} {{#contents}} - public Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#parameters}}{{>serviceQueryParams}}{{>servicePathParams}}{{>serviceHeaderParams}}{{>serviceBodyParams}}{{^isMultipart}}{{>serviceFormParams}},{{/isMultipart}}{{#isMultipart}}{{^isFormParam}},{{/isFormParam}}{{/isMultipart}}{{/parameters}}SecurityContext securityContext) { + public Response {{nickname}}({{#isMultipart}}MultipartFormDataInput input,{{/isMultipart}}{{#parameters}}{{>serviceQueryParams}}{{>servicePathParams}}{{>serviceHeaderParams}}{{>serviceBodyParams}}{{>serviceFormParams}}{{>serviceCookieParams}}{{>comma}}{{/parameters}}SecurityContext securityContext) { // do some magic! return Response.ok().build(); } diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/comma.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/comma.mustache new file mode 100644 index 0000000000..5d8c1f9602 --- /dev/null +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/comma.mustache @@ -0,0 +1 @@ +{{^isFormParam}},{{/isFormParam}}{{#isFormParam}}{{^isBinary}},{{/isBinary}}{{/isFormParam}} \ No newline at end of file diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/cookieParams.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/cookieParams.mustache new file mode 100644 index 0000000000..c8dae79c63 --- /dev/null +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/cookieParams.mustache @@ -0,0 +1,4 @@ +{{#isCookieParam}} +{{#useOas2}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}) {{{dataType}}} {{paramName}}{{/useOas2}} +{{^useOas2}}@Parameter(description = "{{{description}}}" {{#required}},required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}) {{{dataType}}} {{paramName}}{{/useOas2}} +{{/isCookieParam}} diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/model.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/model.mustache index 5efaee7d00..8c70a27988 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/model.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/model.mustache @@ -3,6 +3,7 @@ package {{package}}; {{^x-is-composed-model}} import java.util.Objects; import java.util.ArrayList; +import java.util.HashMap; {{#imports}}import {{import}}; {{/imports}} {{#serializableModel}} diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/pom.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/pom.mustache index 1f6c979d9c..0c755fa3e5 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/pom.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/pom.mustache @@ -120,17 +120,17 @@ org.jboss.resteasy resteasy-servlet-initializer - ${resteasy-version} + 6.2.3.Final org.jboss.resteasy jaxrs-api - ${resteasy-version} + 3.0.12.Final org.jboss.resteasy resteasy-validator-provider-11 - ${resteasy-version} + 3.6.3.Final org.jboss.resteasy @@ -272,7 +272,7 @@ 2.0.0 {{/useOas2}} 9.3.27.v20190418 - 3.0.11.Final + 3.15.6.Final 1.6.3 4.13.1 {{#jakarta}}6.0.0{{/jakarta}}{{^jakarta}}2.5{{/jakarta}} diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/serviceCookieParams.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/serviceCookieParams.mustache new file mode 100644 index 0000000000..70871f0f8c --- /dev/null +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/serviceCookieParams.mustache @@ -0,0 +1 @@ +{{#isCookieParam}}{{{dataType}}} {{paramName}}{{/isCookieParam}} \ No newline at end of file diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/serviceFormParams.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/serviceFormParams.mustache index 72fe3e7ebe..610b6059ac 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/serviceFormParams.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/serviceFormParams.mustache @@ -1 +1 @@ -{{#is this 'form-param'}}{{#isNot this 'binary'}}{{{dataType}}} {{paramName}}{{/isNot}}{{#is this 'binary'}}FormDataContentDisposition fileDetail{{/is}}{{/is}} \ No newline at end of file +{{#isFormParam}}{{^isBinary}}{{{dataType}}} {{paramName}}{{/isBinary}}{{/isFormParam}} \ No newline at end of file From 37bb5b415ad01e5ce7d9eac64af45770ac5b9ec7 Mon Sep 17 00:00:00 2001 From: Hugo Mercado Date: Tue, 16 May 2023 02:18:42 -0500 Subject: [PATCH 7/9] updated jaxrs-resteasy-eap gradle template --- .../handlebars/JavaJaxRS/resteasy/eap/gradle.mustache | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/gradle.mustache b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/gradle.mustache index f0d8e3d9d8..672e74726f 100644 --- a/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/gradle.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/resteasy/eap/gradle.mustache @@ -8,13 +8,13 @@ repositories { } dependencies { - providedCompile 'org.jboss.resteasy:resteasy-jaxrs:3.0.11.Final' - providedCompile 'org.jboss.resteasy:jaxrs-api:3.0.11.Final' - providedCompile 'org.jboss.resteasy:resteasy-validator-provider-11:3.0.11.Final' - providedCompile 'org.jboss.resteasy:resteasy-multipart-provider:3.0.11.Final' + providedCompile 'org.jboss.resteasy:resteasy-jaxrs:3.15.6.Final' + providedCompile 'org.jboss.resteasy:jaxrs-api:3.0.12.Final' + providedCompile 'org.jboss.resteasy:resteasy-validator-provider-11:3.6.3.Final' + providedCompile 'org.jboss.resteasy:resteasy-multipart-provider:3.15.6.Final' providedCompile 'jakarta.annotation:jakarta.annotation-api:{{#jakarta}}2.1.1{{/jakarta}}{{^jakarta}}1.3.5{{/jakarta}}' providedCompile 'org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:1.0.0.Final' - compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' + compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.15.6.Final' {{#useBeanValidation}} providedCompile 'jakarta.validation:jakarta.validation-api:{{#jakarta}}3.0.2{{/jakarta}}{{^jakarta}}2.0.2{{/jakarta}}' {{/useBeanValidation}} From aa2fc02f616d4998ac32d666af4608939d35467a Mon Sep 17 00:00:00 2001 From: Hugo Mercado Date: Tue, 16 May 2023 03:15:52 -0500 Subject: [PATCH 8/9] updated jaxrs-cxf templates to fix build errors --- src/main/resources/handlebars/JavaJaxRS/cxf/api.mustache | 2 +- .../resources/handlebars/JavaJaxRS/cxf/apiServiceImpl.mustache | 2 +- .../resources/handlebars/JavaJaxRS/cxf/cookieParams.mustache | 1 + .../handlebars/JavaJaxRS/cxf/cookieParamsImpl.mustache | 1 + src/main/resources/handlebars/JavaJaxRS/cxf/server/pom.mustache | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 src/main/resources/handlebars/JavaJaxRS/cxf/cookieParams.mustache create mode 100644 src/main/resources/handlebars/JavaJaxRS/cxf/cookieParamsImpl.mustache diff --git a/src/main/resources/handlebars/JavaJaxRS/cxf/api.mustache b/src/main/resources/handlebars/JavaJaxRS/cxf/api.mustache index f0f52851eb..c2d3005aa9 100644 --- a/src/main/resources/handlebars/JavaJaxRS/cxf/api.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/cxf/api.mustache @@ -96,7 +96,7 @@ public interface {{classname}} { @ApiResponses(value = { {{#responses}} @ApiResponse(responseCode = "{{{code}}}", description = "{{{message}}}"{{^vendorExtensions.x-java-is-response-void}}, content = @Content({{#schema.extensions.x-content-type}}mediaType = "{{schema.extensions.x-content-type}}", {{/schema.extensions.x-content-type}}{{^containerType}}schema = @Schema(implementation = {{{baseType}}}.class)){{/containerType}}{{#containerType}}array = @ArraySchema(schema = @Schema(implementation = {{{baseType}}}.class))){{/containerType}}{{/vendorExtensions.x-java-is-response-void}}){{#hasMore}},{{/hasMore}}{{/responses}} }) {{/useOas2}} - public {{>returnTypes}} {{nickname}}({{#parameters}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{/parameters}}); + public {{>returnTypes}} {{nickname}}({{#parameters}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>cookieParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}}, {{/hasMore}}{{/parameters}}); {{/contents}} {{/operation}} } diff --git a/src/main/resources/handlebars/JavaJaxRS/cxf/apiServiceImpl.mustache b/src/main/resources/handlebars/JavaJaxRS/cxf/apiServiceImpl.mustache index d0397b6f1f..7e54832af9 100644 --- a/src/main/resources/handlebars/JavaJaxRS/cxf/apiServiceImpl.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/cxf/apiServiceImpl.mustache @@ -54,7 +54,7 @@ public class {{classname}}ServiceImpl implements {{classname}} { {{/notes}} */ {{/summary}} - public {{>returnTypes}} {{nickname}}({{#parameters}}{{>queryParamsImpl}}{{>pathParamsImpl}}{{>headerParamsImpl}}{{>bodyParamsImpl}}{{>formParamsImpl}}{{#hasMore}}, {{/hasMore}}{{/parameters}}) { + public {{>returnTypes}} {{nickname}}({{#parameters}}{{>queryParamsImpl}}{{>pathParamsImpl}}{{>headerParamsImpl}}{{>cookieParamsImpl}}{{>bodyParamsImpl}}{{>formParamsImpl}}{{#hasMore}}, {{/hasMore}}{{/parameters}}) { // TODO: Implement... {{#useGenericResponse}}return Response.ok().entity("magic!").build();{{/useGenericResponse}}{{^useGenericResponse}}{{^vendorExtensions.x-java-is-response-void}}return null;{{/vendorExtensions.x-java-is-response-void}}{{/useGenericResponse}} diff --git a/src/main/resources/handlebars/JavaJaxRS/cxf/cookieParams.mustache b/src/main/resources/handlebars/JavaJaxRS/cxf/cookieParams.mustache new file mode 100644 index 0000000000..4af2e57d24 --- /dev/null +++ b/src/main/resources/handlebars/JavaJaxRS/cxf/cookieParams.mustache @@ -0,0 +1 @@ +{{#isCookieParam}}@CookieParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isCookieParam}} \ No newline at end of file diff --git a/src/main/resources/handlebars/JavaJaxRS/cxf/cookieParamsImpl.mustache b/src/main/resources/handlebars/JavaJaxRS/cxf/cookieParamsImpl.mustache new file mode 100644 index 0000000000..70871f0f8c --- /dev/null +++ b/src/main/resources/handlebars/JavaJaxRS/cxf/cookieParamsImpl.mustache @@ -0,0 +1 @@ +{{#isCookieParam}}{{{dataType}}} {{paramName}}{{/isCookieParam}} \ No newline at end of file diff --git a/src/main/resources/handlebars/JavaJaxRS/cxf/server/pom.mustache b/src/main/resources/handlebars/JavaJaxRS/cxf/server/pom.mustache index b4b34b8f46..31c6ff7b36 100644 --- a/src/main/resources/handlebars/JavaJaxRS/cxf/server/pom.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/cxf/server/pom.mustache @@ -336,7 +336,7 @@ {{#generateSpringBootApplication}} 1.5.9.RELEASE {{/generateSpringBootApplication}} - {{#jakarta}}4.0.0{{/jakarta}}{{^jakarta}}3.2.4abstract{{/jakarta}} + {{#jakarta}}4.0.0{{/jakarta}}{{^jakarta}}3.2.4{{/jakarta}} 2.9.1 UTF-8 From 24a162cf8208ec889f180cf5313e41fc3eb32407 Mon Sep 17 00:00:00 2001 From: Hugo Mercado Date: Tue, 16 May 2023 05:11:56 -0500 Subject: [PATCH 9/9] updated jaxrs-jersey templates --- .../handlebars/JavaJaxRS/formParams.mustache | 3 +- .../JavaJaxRS/libraries/jersey1/api.mustache | 4 +-- .../libraries/jersey1/apiService.mustache | 2 +- .../libraries/jersey1/apiServiceImpl.mustache | 2 +- .../libraries/jersey1/formParams.mustache | 3 +- .../JavaJaxRS/libraries/jersey1/pom.mustache | 31 +++++++++++++++--- .../handlebars/JavaJaxRS/pom.mustache | 32 +++++++++++++++---- .../JavaJaxRS/serviceFormParams.mustache | 2 +- 8 files changed, 59 insertions(+), 20 deletions(-) diff --git a/src/main/resources/handlebars/JavaJaxRS/formParams.mustache b/src/main/resources/handlebars/JavaJaxRS/formParams.mustache index 96e8a148e0..5bd5a1cf3f 100644 --- a/src/main/resources/handlebars/JavaJaxRS/formParams.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/formParams.mustache @@ -1,2 +1 @@ -{{#is this 'form-param'}}{{#isNot this 'binary'}}{{#useOas2}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{#vendorExtensions.x-multipart}}@FormDataParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/useOas2}}{{^useOas2}}@Parameter(description = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}){{#vendorExtensions.x-multipart}}@FormDataParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/useOas2}}{{/isNot}}{{#is this 'binary'}}@FormDataParam("{{baseName}}") InputStream {{paramName}}InputStream, - @FormDataParam("{{baseName}}") FormDataContentDisposition {{paramName}}Detail{{/is}}{{/is}} +{{#isFormParam}}{{^isBinary}}{{#useOas2}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{#vendorExtensions.x-multipart}}@FormDataParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/useOas2}}{{^useOas2}}@Parameter(description = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}){{#vendorExtensions.x-multipart}}@FormDataParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/useOas2}}{{/isBinary}}{{#isBinary}}@FormDataParam("{{baseName}}") InputStream {{paramName}}InputStream, @FormDataParam("{{baseName}}") FormDataContentDisposition {{paramName}}Detail{{/isBinary}}{{/isFormParam}} \ No newline at end of file diff --git a/src/main/resources/handlebars/JavaJaxRS/libraries/jersey1/api.mustache b/src/main/resources/handlebars/JavaJaxRS/libraries/jersey1/api.mustache index 2d5a496863..03cd721e53 100644 --- a/src/main/resources/handlebars/JavaJaxRS/libraries/jersey1/api.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/libraries/jersey1/api.mustache @@ -68,10 +68,10 @@ public class {{classname}} { @io.swagger.annotations.ApiResponses(value = { {{#responses}} @io.swagger.annotations.ApiResponse(code = {{{code}}}, message = "{{{message}}}", response = {{{baseType}}}.class{{#containerType}}, responseContainer = "{{{containerType}}}"{{/containerType}}){{#hasMore}},{{/hasMore}}{{/responses}} }) public Response {{nickname}}( - {{#parameters}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}, + {{#parameters}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>serviceCookieParams}}, {{/parameters}}@Context SecurityContext securityContext) throws NotFoundException { - return delegate.{{nickname}}({{#parameters}}{{#isBinary}} {{paramName}}InputStream, {{paramName}}Detail{{/isBinary}}{{^isBinary}}{{paramName}}{{/isBinary}},{{/parameters}}securityContext); + return delegate.{{nickname}}({{#parameters}}{{#isBinary}}{{#isBodyParam}}{{paramName}}{{/isBodyParam}}{{^isBodyParam}}{{paramName}}InputStream, {{paramName}}Detail{{/isBodyParam}}{{/isBinary}}{{^isBinary}}{{paramName}}{{/isBinary}},{{/parameters}}securityContext); } {{/contents}} {{/operation}} diff --git a/src/main/resources/handlebars/JavaJaxRS/libraries/jersey1/apiService.mustache b/src/main/resources/handlebars/JavaJaxRS/libraries/jersey1/apiService.mustache index 8da4c2b7fd..6b18780d60 100644 --- a/src/main/resources/handlebars/JavaJaxRS/libraries/jersey1/apiService.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/libraries/jersey1/apiService.mustache @@ -38,7 +38,7 @@ import javax.validation.constraints.*; public abstract class {{classname}}Service { {{#operation}} {{#contents}} - public abstract Response {{nickname}}({{#parameters}}{{>serviceQueryParams}}{{>servicePathParams}}{{>serviceHeaderParams}}{{>serviceBodyParams}}{{>serviceFormParams}},{{/parameters}}SecurityContext securityContext) + public abstract Response {{nickname}}({{#parameters}}{{>serviceQueryParams}}{{>servicePathParams}}{{>serviceHeaderParams}}{{>serviceBodyParams}}{{>serviceFormParams}}{{>serviceCookieParams}},{{/parameters}}SecurityContext securityContext) throws NotFoundException; {{/contents}} {{/operation}} diff --git a/src/main/resources/handlebars/JavaJaxRS/libraries/jersey1/apiServiceImpl.mustache b/src/main/resources/handlebars/JavaJaxRS/libraries/jersey1/apiServiceImpl.mustache index ba8b4156d8..ee19b24d80 100644 --- a/src/main/resources/handlebars/JavaJaxRS/libraries/jersey1/apiServiceImpl.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/libraries/jersey1/apiServiceImpl.mustache @@ -39,7 +39,7 @@ public class {{classname}}ServiceImpl extends {{classname}}Service { {{#operation}} {{#contents}} @Override - public Response {{nickname}}({{#parameters}}{{>serviceQueryParams}}{{>servicePathParams}}{{>serviceHeaderParams}}{{>serviceBodyParams}}{{>serviceFormParams}}, {{/parameters}}SecurityContext securityContext) + public Response {{nickname}}({{#parameters}}{{>serviceQueryParams}}{{>servicePathParams}}{{>serviceHeaderParams}}{{>serviceBodyParams}}{{>serviceFormParams}}{{>serviceCookieParams}}, {{/parameters}}SecurityContext securityContext) throws NotFoundException { // do some magic! return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build(); diff --git a/src/main/resources/handlebars/JavaJaxRS/libraries/jersey1/formParams.mustache b/src/main/resources/handlebars/JavaJaxRS/libraries/jersey1/formParams.mustache index d9b7151f76..5bd5a1cf3f 100644 --- a/src/main/resources/handlebars/JavaJaxRS/libraries/jersey1/formParams.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/libraries/jersey1/formParams.mustache @@ -1,2 +1 @@ -{{#is this 'form-param'}}{{#isNot this 'binary'}}{{#isNot this 'multipart'}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{/isNot}}{{#is this 'multipart'}}@FormDataParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/is}}{{#isNot this 'multipart'}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/isNot}}{{/isNot}}{{#is this 'binary'}}@FormDataParam("{{baseName}}") InputStream inputStream, - @FormDataParam("{{baseName}}") FormDataContentDisposition fileDetail{{/is}}{{/is}} \ No newline at end of file +{{#isFormParam}}{{^isBinary}}{{#useOas2}}@ApiParam(value = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}{{#defaultValue}}, defaultValue="{{{defaultValue}}}"{{/defaultValue}}){{#vendorExtensions.x-multipart}}@FormDataParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/useOas2}}{{^useOas2}}@Parameter(description = "{{{description}}}"{{#required}}, required=true{{/required}}{{#allowableValues}}, {{> allowableValues }}{{/allowableValues}}){{#vendorExtensions.x-multipart}}@FormDataParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{^vendorExtensions.x-multipart}} {{#defaultValue}} @DefaultValue("{{{defaultValue}}}"){{/defaultValue}} @FormParam("{{baseName}}") {{{dataType}}} {{paramName}}{{/vendorExtensions.x-multipart}}{{/useOas2}}{{/isBinary}}{{#isBinary}}@FormDataParam("{{baseName}}") InputStream {{paramName}}InputStream, @FormDataParam("{{baseName}}") FormDataContentDisposition {{paramName}}Detail{{/isBinary}}{{/isFormParam}} \ No newline at end of file diff --git a/src/main/resources/handlebars/JavaJaxRS/libraries/jersey1/pom.mustache b/src/main/resources/handlebars/JavaJaxRS/libraries/jersey1/pom.mustache index 8b3b02da17..0ab2bef863 100644 --- a/src/main/resources/handlebars/JavaJaxRS/libraries/jersey1/pom.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/libraries/jersey1/pom.mustache @@ -138,20 +138,27 @@ jersey-server ${jersey-version} -{{#jakarta}} + {{#jakarta}} jakarta.servlet jakarta.servlet-api ${servlet-api-version} -{{/jakarta}} -{{^jakarta}} + + + jakarta.platform + jakarta.jakartaee-api + 10.0.0 + provided + + {{/jakarta}} + {{^jakarta}} javax.servlet servlet-api ${servlet-api-version} -{{/jakarta}} + {{/jakarta}} junit @@ -214,6 +221,20 @@ {{/jakarta}} {{/useBeanValidation}} + {{#java8}} + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + {{/java8}} + {{^java8}} + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + {{/java8}} @@ -231,7 +252,7 @@ 1.5.18 9.2.9.v20150224 1.19.1 - 2.8.9 + 2.9.5 1.7.21 4.13.1 {{#jakarta}}6.0.0{{/jakarta}}{{^jakarta}}2.5{{/jakarta}} diff --git a/src/main/resources/handlebars/JavaJaxRS/pom.mustache b/src/main/resources/handlebars/JavaJaxRS/pom.mustache index 0e4d15d542..2c3b9d0799 100644 --- a/src/main/resources/handlebars/JavaJaxRS/pom.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/pom.mustache @@ -58,7 +58,6 @@ jakarta.validation jakarta.validation-api ${beanvalidation-version} - provided {{/jakarta}} {{^jakarta}} @@ -147,11 +146,27 @@ ${junit-version} test + {{#jakarta}} - javax.servlet - servlet-api - ${servlet-api-version} + jakarta.servlet + jakarta.servlet-api + ${servlet-api-version} + + + jakarta.platform + jakarta.jakartaee-api + 10.0.0 + provided + + {{/jakarta}} + {{^jakarta}} + + javax.servlet + servlet-api + ${servlet-api-version} + + {{/jakarta}} org.glassfish.jersey.containers jersey-container-servlet-core @@ -219,7 +234,12 @@ jakarta.validation jakarta.validation-api ${beanvalidation-version} - provided + + + + jakarta.annotation + jakarta.annotation-api + 2.1.1 {{/jakarta}} {{^jakarta}} @@ -261,7 +281,7 @@ {{/supportJava6}} 4.13.1 1.2.9 - 2.5 + {{#jakarta}}6.0.0{{/jakarta}}{{^jakarta}}2.5{{/jakarta}} {{#useBeanValidation}} {{#jakarta}}3.0.2{{/jakarta}}{{^jakarta}}1.1.0.Final{{/jakarta}} {{/useBeanValidation}} diff --git a/src/main/resources/handlebars/JavaJaxRS/serviceFormParams.mustache b/src/main/resources/handlebars/JavaJaxRS/serviceFormParams.mustache index 610b6059ac..56d43d61c5 100644 --- a/src/main/resources/handlebars/JavaJaxRS/serviceFormParams.mustache +++ b/src/main/resources/handlebars/JavaJaxRS/serviceFormParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isBinary}}{{{dataType}}} {{paramName}}{{/isBinary}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isBinary}}{{{dataType}}} {{paramName}}{{/isBinary}}{{#isBinary}}java.io.InputStream {{paramName}}InputStream, FormDataContentDisposition {{paramName}}Detail{{/isBinary}}{{/isFormParam}} \ No newline at end of file