I have requirement to pass a Optional parameter (count) to GET method. I tried below.
@RequestMapping(value = {"/findDetail","/findDetail/{no}"}, method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public int findAll(@PathVariable Optional<Integer> no) {
//find method takes Optional argument.
return ticketService.find(no);
}
I am expecting some value here but no always has null. Did I miss something here?