I'm building a rest API that should accept any number of parameters that I pass into it. Is there a way to configure this in Java?
Below I have a REST API method with 2 parameters, but I'd like it to accept just 1 or up to any number (50 for example).
@GetMapping("/rest/bagel")
public Collection<String> bagel(
@RequestParam(value = REQUEST_PARAM_BAGEL_ORG) String bagelOrg,
@RequestParam(value = REQUEST_PARAM_BAGEL_REGION) String bagelRegion) {
return bagelService.getBagel(bagelOrg, bagelRegion);
}