diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/simple/SeparatorQueryParamTest.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/simple/SeparatorQueryParamTest.java index b8973cd1edce6..c520568020663 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/simple/SeparatorQueryParamTest.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/simple/SeparatorQueryParamTest.java @@ -4,6 +4,7 @@ import java.util.List; +import javax.ws.rs.BeanParam; import javax.ws.rs.GET; import javax.ws.rs.Path; @@ -32,6 +33,15 @@ public void noQueryParams() { .header("x-size", "0"); } + @Test + public void noQueryParamsBean() { + get("/hello/bean") + .then() + .statusCode(200) + .body(Matchers.equalTo("hello world")) + .header("x-size", "0"); + } + @Test public void singleQueryParam() { get("/hello?name=foo") @@ -41,6 +51,15 @@ public void singleQueryParam() { .header("x-size", "1"); } + @Test + public void singleQueryParamBean() { + get("/hello/bean?name=foo") + .then() + .statusCode(200) + .body(Matchers.equalTo("hello foo")) + .header("x-size", "1"); + } + @Test public void multipleQueryParams() { get("/hello?name=foo,bar&name=one,two,three&name=yolo") @@ -55,6 +74,16 @@ public static class HelloResource { @GET public RestResponse hello(@RestQuery("name") @Separator(",") List names) { + return toResponse(names); + } + + @GET + @Path("bean") + public RestResponse helloBean(@BeanParam Bean bean) { + return toResponse(bean.names); + } + + private RestResponse toResponse(List names) { int size = names.size(); String body = ""; if (names.isEmpty()) { @@ -66,4 +95,10 @@ public RestResponse hello(@RestQuery("name") @Separator(",") List names; + } } diff --git a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/Separator.java b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/Separator.java index 86e2629e80c46..bee058ff3d280 100644 --- a/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/Separator.java +++ b/independent-projects/resteasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/Separator.java @@ -11,7 +11,7 @@ * parameter (using the value of the annotation) and populate the list with those values. */ @Retention(RetentionPolicy.RUNTIME) -@Target({ ElementType.PARAMETER }) +@Target({ ElementType.PARAMETER, ElementType.FIELD }) public @interface Separator { String value();