You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow controller parameter annotations (@RequestMapping, @PathVariable...) to be read from interfaces or parent classes #7730
We are trying to use external REST API definition that would generate interfaces one implements in Java. For the time being we try to use Swagger.
Unfortunately Spring does not allow us to separate the API definition from implementation as the parameter annotations on controllers are not read from interfaces. Instead of that Spring always looks into the concrete implementation whose purpose is to implement a contract not define it. Weirdly enough the @RequestMapping annotation can be declared on the interface and is picked up by the implementing controller. It would be great if similar functionality is provided for @RequestBody, @PathVariable, @RequestHeader etc. that are defined on the individual parameters.
It seems that a potential fix has to update/extend the implementation of
@karaatanassov Thanks for the suggestion but this is something that the core Spring MVC team would need to consider. You can raise an issue on their tracker here.
Activity
philwebb commentedon Dec 22, 2016
@karaatanassov Thanks for the suggestion but this is something that the core Spring MVC team would need to consider. You can raise an issue on their tracker here.
bclozel commentedon Dec 27, 2016
For reference: SPR-15046 was raised, which is a duplicate of SPR-11055.