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 (@RequestBody, @PathVariable...) to be defined on interfaces or parent classes [SPR-15046] #19612
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
Activity
spring-projects-issues commentedon Dec 23, 2016
Juergen Hoeller commented
This seems like a duplicate of #15682 which we intend to address for 5.0 RC1.