It seems that Spring-MVC interprets it as a controller. If you use an Hystrix fallback inheriting from the interface, then it even fails at startup saying that there are two controllers for the same mapping.
Comment From: cbornet
See https://github.com/spring-cloud/spring-cloud-netflix/issues/466
Comment From: dsyer
Clarification: ut's only a problem if you have both a @FeignClient and a @Controller with the same type-level annotation (e.g. if they share an interface). Since this makes very little sense for a real application, it's not super urgent to do anything on our side (and it would take a change in Spring Framework anyway) to support it. Documentation is definitely a good idea if anyone wants to propose a change.
Comment From: cbornet
Note : in a spring-boot app, it crashes if you have both a @FeignClient and a FeignHystrixCallback implementing the interface because Spring-MVC complains about ambiguous path mapping.
Comment From: dsyer
Right, yes. That's worth documenting as well: you can't use fallback= in @FeignClient if there is a @RequestMapping on the interface.
Comment From: cbornet
It also gets scanned by springfox and probably other tools. Lots of worries :smile: ...
Comment From: yuliangjin1985
Yes, when I used swagger and there are two controller and feignclient but accidently they have the same RequestMapping, then there are IllegalStateException: Ambiguous mapping, and the project failed starting.
Comment From: jenimal
Hi @OlgaMaciaszek give me something easy so I cam step through a pull and remerge "the right way"
Comment From: OlgaMaciaszek
@jenimal you can work on this issue.
Comment From: OlgaMaciaszek
Will be switching it from a documentation-only issue to an enhancement. We think using @RequestMapping over @FeignClient interfaces is a bad practice and are going to remove the support for creating Feign clients annotated with @RequestMapping on interface level.
Comment From: OlgaMaciaszek
Done with d6783a6f1ec8dd08fafe76ecd072913d4e6f66b9.