Why Optional and @PathVariable combination is not supported by Spring/java?

I would like to make an api the could accept two Path variables and one of them could be optional. In this article they said that we can achieve this by using Optional but this not working here is my Controller @GetMapping(“/users/{dateDu}/{dateAu}”) public ResponseEntity<List<User>> getAllUsersByDate( @PathVariable LocalDate dateDu, @PathVariable(required = false) Optional<LocalDate> dateAu, @org.springdoc.api.annotations.ParameterObject Pageable … Read more