I already went through: How to define an optional parameter in path using swagger.
I've this endpoint:
@ApiOperation(value = "Retrieve Student Data By firstName Or lastName Or middleName",nickname = "Find Student Data")
@ApiResponses(value = { @ApiResponse(code = 200, message = "Successfully Retrieved Student Data"),
@ApiResponse(code = 404, message = "No data found !!!") })
@GetMapping(path = "/firstName/{firstName}/lastName/{lastName}/middleName/{middleName}")
public GetStudentDataResponse getStudentData(@PathVariable(required = false) String firstName, @PathVariable(required = false) String lastName,@PathVariable(required = false) String middleName) {
return service.getStudentData(firstName,lastName,middleName);
}
When I hit the rest endpoint and pass firstName only, Swagger is complaining about required parameter. How can we disabled it ?
Note: I really don't want to create another endpoint just to create / for the sake of to make it working via swagger.