I have the GET request like
/api/v1/data?name=aaa&name=bbb&name=cccc&name=dd&name....
I want to limit the number of 'name' param, it must be no more than 100 (configurable in properties file)
Here is my controller
public Data getDataByNames(@RequestParam(value = "name") List<String> names) {
return userService.getDataByNames(names);
}
How can I do that? Thanks
Update: yeah, I can check in service layer: if(names.size() < 100) {...} but it seem not professional