@getMapping one overloading URL
@GetMapping("/endpoint")
public Response getStuff(@RequestParam(value = "foo", required = false) String foo,
@RequestParam(value = "bar", required = false) String bar) {
if (foo != null)
// do stuff for foo
else if (bar != null)
// do stuff for bar
}