spring-framework / org.springframework.web.bind.annotation / RequestPart / required

required

val required: Boolean

Whether the part is required.

Defaults to true, leading to an exception being thrown if the part is missing in the request. Switch this to false if you prefer a null value if the part is not present in the request.