I have 2 GET handler methods
@RestController
public class TestController {
...
@GetMapping(name = "/test")
public Test testMethod() {
return testService.getTest();
}
@GetMapping(name = "/test/{count}")
public List<Test> getTestList2(@PathVariable(name = "count") Integer count) {
return testService.getTestList(count);
}
}
And I get error:
Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'testController' method
public java.util.List<models.Test> TestController.getTestList2(java.lang.Integer)
to {[],methods=[GET]}: There is already 'testController' bean method
If I comment one method all work fine