Skip to content

[validation] detect path in controller annotation param #1582

Open
@martinlippert

Description

@martinlippert
@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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions