My controller looks something like this;
@PostMapping(path = RequestMappingConstants.CALCULATE_INTEREST, consumes = MediaType.APPLICATION_JSON_VALUE)
private ResponseEntity<Response> execute(@Valid @RequestBody @Size(min = 1) List<Long> Ids)
throws BusinessException {
this.processService.execute(Ids);
return ResponseEntity.ok(Response.builder().build());
}
I tried using other validations like @Notnull @NotBlank etc but the validations are not getting invoked.
I do not have the option to wrap List<Long> Ids
inside a Bean / DTO since my requirement is to make sure the request looks something like this;
[1L,2L,3L]
Creating a custom validation from JSR does not get invoked either, any ideas or suggestions to do these validations based on best practices ?