I have this controller file with the following code
@PostMapping(path = "/addDefaultTemplate")
void addDefaultTemplate(@Valid @ModelAttribute AddDefaultTemplate defaultTemplate) throws Exception {
//Logic
}
And i have this AddDefaultTemplate java file
@Data
public class AddDefaultTemplate {
@NotBlank
String name;
@NotNull
String category;
@NotNull
String type;
@NotNull
MultipartFile[] file;
}
When i comment the multipartfile configuration in the above class, the url is working fine. If i add the multipartfile in the above class url throws 400 error. Why, what's the reason?