public void upload(@RequestPart MultipartFile[] files){ ...}

The above comments @RequestPart, Default property required=true. When I receive an array of files, if the files property is not passed, the check still passes, because reading the source code shows that if the files property is not passed, the empty array is returned instead of null.

MultipartResolutionDelegate.java Spring @RequestPart with array of MultipartFile doesn't raise exception when no file part is received

RequestPartMethodArgumentResolver.java Spring @RequestPart with array of MultipartFile doesn't raise exception when no file part is received

Comment From: bclozel

I can't reproduce the behavior you're explaining here with a Spring Boot 3.0 application.

Can you share a sample project that reproduces the problem, ideally minimal and starting from https://start.spring.io? Thanks

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.