In the web service I\'m working on, I need to implement a URI with query parameters which look like /stats?store=A&store=B&item=C&item=D
To
Some libs like axios js use the square brackets notation when sending a multi-value param request: /stats?store[]=A&store[]=B&item[]=C&item[]=D
To handle all cases (with or without square brackets) you can add another param like this:
public String methodImCalling(
@QueryParam(value = "store") final List store,
@QueryParam(value = "store[]") final List storeWithBrackets,
@QueryParam(value = "item") final List item,
@QueryParam(value = "item[]") final List itemWithBrackets) {
...
}
Inspecting each of the arguments checking for null.