Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring back @RequestMapping #678

Closed
Sam-Kruglov opened this issue Feb 14, 2022 · 1 comment
Closed

Bring back @RequestMapping #678

Sam-Kruglov opened this issue Feb 14, 2022 · 1 comment
Labels
question Further information is requested

Comments

@Sam-Kruglov
Copy link
Contributor

Sam-Kruglov commented Feb 14, 2022

Is your feature request related to a problem? Please describe.
I used @RequestMapping on class level to define a root URL path, like @RequestMapping("api/v1/users") class UsersApi { ... methods all related to users ... }. But this commit removed support for it, so now I have to copy-paste "api/v1/users/" into all my methods.

The commit seems to justify it as a discouragement for sharing the feign interface with server controller classes. I think a better solution would be to add code to Spring MVC that would detect @FeignClient annotation on a @Controller's interface and throw an error that way, so we can bring back @RequestMapping. I know that Java doesn't allow reading interface's annotations but Feign does it somehow, maybe Spring MVC can do that too? If it can't, then I propose to introduce a feign-specific class-level annotation for root URL path.

Note: @RequestMapping allows for other things to be configured for all methods, like content type.

Describe alternatives you've considered
A lot of copy-paste seems to be the only way.

@OlgaMaciaszek OlgaMaciaszek added question Further information is requested and removed waiting-for-triage labels Feb 14, 2022
@OlgaMaciaszek
Copy link
Collaborator

Hello, @Sam-Kruglov, this was done on purpose (see https://tanzu.vmware.com/security/cve-2021-22044 and #547). It was always discouraged as a bad practice in the docs. Since it also caused a security issue, the team has decided to remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants