-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a ParamConverterProvider for array support #4684
Conversation
shouldn't it be for jakartified spec only? |
Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make tests for cases 3 and 4, too.
for 4 for instance:
public static class ArrayTestBean {
private final String value;
private ArrayTestBean(String value) {
this.value = value;
}
public static ArrayTestBean fromString(String bean) {
return new ArrayTestBean(bean);
}
@Override
public String toString() {
return value;
}
}
@Path("/queryBeanArray")
@GET
public Response queryBeanArray(@QueryParam(PARAM_NAME) ArrayTestBean[] data) {
StringBuilder sb = new StringBuilder(data.length);
for (ArrayTestBean d : data) {
sb.append(d);
}
return Response.ok(sb.toString()).build();
}
@Path("/queryBeanList")
@GET
public Response queryBeanList(@QueryParam(PARAM_NAME) List<ArrayTestBean> data) {
StringBuilder sb = new StringBuilder(data.size());
for (ArrayTestBean d : data) {
sb.append(d);
}
return Response.ok(sb.toString()).build();
}
@Test
public void queryBean() {
Response expected = target("/test/queryBeanList").queryParam(PARAM_NAME, "1", "2").request().get();
Response arrayResponse = target("/test/queryBeanArray").queryParam(PARAM_NAME, "1", "2").request().get();
verifyStr(expected, arrayResponse);
}
@@ -0,0 +1,108 @@ | |||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this test in this package? Assumingly it should be next to similar tests, in tests/e2e-server perhaps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to know. By default I was adding tests in JDK connector.
* | ||
* @param type the type class to manage runtime generic. | ||
* @param parameterName extracted parameter name. | ||
* @param defaultValue default parameter value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no defaultValue
param
For 3.1, it would be a MUST. For 2.x, it is an enhancement. |
Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
Primitive types are supported in the last commit |
Relates to this: jakartaee/rest#890
Primitive types are not supported. That is said here in the part '
T
satisfies 1, 3 or 4 above.':jakartaee/rest#891