Open
Description
@RestController("/employees")
public class EmployeeController {
might look correct, but it isn't. @Controller
annotations take the bean name as the default parameter (as every other stereotype annotation, too), so the code above is correct, but the author might had in mind to add the default path instead of the bean name.
This issue is to add a validation that detects strings args in controller annotations that look like a path and highlight that this might be wrong. As a quick fix, we can offer to add a @RequestMapping
annotation to the class with the mentioned path as a parameter (and remove the parameter from the @Controller
annotation).