I want to validate extension of Multipartfile object. I added @Valid and my custon annotation to parameter @ImageFileValid
but it doesn't work.
@PutMapping("/{id}")
ProductDto updateProduct(@RequestPart @Valid ProductDto product, @PathVariable Long id,@RequestPart @Valid @ImageFileValid MultipartFile image) {
return productMapper.productToProductDto(productService.update(productMapper.productDtoToProduct(product),id));
}