nerdErg / swagger4jaxrs

This is a Grails plugin that adds Swagger support to document REST APIs of any Grails projects that use the Grails JAX-RS (JSR 311) plugin.
Apache License 2.0
10 stars 10 forks source link

Automaticaly retrieve the path for a controller action? #7

Closed loic911 closed 10 years ago

loic911 commented 10 years ago

Hi,

I'm interested using swagger4jaxrs for my API.

Would it be possible in the futur, to automaticaly retrieve the path for a controller action? A nice feature would be to be able to "remove" @Path("/login") and to automaticaly detect that "loginUser" from "UserResource" controller is called from "/login" (defined by a custom urlmapping rule or by the grails auto rule /controller/action).

Would it be possible?

Thanks

aruizca commented 10 years ago

Hi,

I reckon that feature request is out of reach for this plugin as the only thing it provides is an easy integration between the JAX-RS plugin and the swagger tool. The problem with your proposed convention is that it sits outside the JAX-RS standard (JSR-311), so Jersey (or any other compliant JAX-RS implementation) would not understand it, so you would not really have a REST endpoint for that particular method. Swagger "simply" introspects all the JAX-RS resources and extract metadata from the relevant annotations to generate a JSON.document with the information.

Cheers,