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

required

val required: Boolean

Whether the path variable is required.

Defaults to true, leading to an exception being thrown if the path variable is missing in the incoming request. Switch this to false if you prefer a null or Java 8 java.util.Optional in this case. e.g. on a ModelAttribute method which serves for different requests.

Since
4.3.3