Spring Boot- Spring MVC Project below Rest API
@GetMapping(value = "bulk/{speakerIds}")
@ResponseStatus(HttpStatus.MULTI_STATUS)
@Operation(summary = "Gets Speakers to a max Limit of 10")
public Map<Long, Object> getMasterClassBulk(@PathVariable List<Long> speakerIds) {
return speakerHandler.getSpeakers(speakerIds);
}
Is there a way to add List Max Size validation ? Eg: When the input list exceeds size 10, throw 404-Bad Request
Tried below code, but it does not work.
@PathVariable @Size(max=10) List<Long> speakerIds
@Validatedannotation/bulk/[1,2,3]?? (urlencoded:/bulk/%5B1%2C2%2C3%5D;)