Spring Boot MVC: validate a multipart/form-data RequestBody
Hello! I have the need to fill a form with some meta data and a file. The meta data required fields depends on the media "type" that you're selecting from a drop-down.
I've thus created a custom validator, associated to a custom annotation and put all on the PostMapping action annotating the parameter with
Thank you very much
The DTO + validator:
The controller's method:
I've shortened the code as much as possible to stay in the chars limit, please ask me anything which might be related.
Thank you very much!
I've thus created a custom validator, associated to a custom annotation and put all on the PostMapping action annotating the parameter with
@Valid @MyCustomAnnotation (see below). The thing is that the validator is not being called for a reason beyond my knowledge. May you please help me understand what I'm doing wrong?Thank you very much
The DTO + validator:
The controller's method:
I've shortened the code as much as possible to stay in the chars limit, please ask me anything which might be related.
Thank you very much!