springfox-grails-integration icon indicating copy to clipboard operation
springfox-grails-integration copied to clipboard

allow supplying a custom path for an action

Open zyro23 opened this issue 8 years ago • 2 comments

it would be good to have a way to configure a custom path for an action.

if you have multiple url mappings poiting to the same action, currently only the default one created by linkGenerator is used.

something like an @ApiPath annotation would be cool.

zyro23 avatar Jan 15 '17 11:01 zyro23

Hmmm interesting. Since we don't go from url mapping -> controller is why we probably don't account for it. Curious how @RequestMapping plays with grails?

dilipkrish avatar Jan 15 '17 12:01 dilipkrish

you can use spring @Controller beans like in a normal spring web app.

on grails actions, @RequestMapping should not have any effect (grails does not "know" the annotation and spring does not scan grails controller beans for request mappings).

ref:

  • https://github.com/spring-projects/spring-framework/blob/v4.3.5.RELEASE/spring-webmvc/src/main/java/org/springframework/web/servlet/handler/AbstractHandlerMethodMapping.java#L213
  • https://github.com/spring-projects/spring-framework/blob/v4.3.5.RELEASE/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping.java#L172

zyro23 avatar Jan 15 '17 13:01 zyro23