trailsjs / sails-swagger

Swagger integration for sails.js
107 stars 47 forks source link

Add options to select which routes should be documented #8

Open AlexisNo opened 9 years ago

AlexisNo commented 9 years ago

Today, all routes are added to the swagger document. A user should be allowed to select what kind of routes he wants to document:

One may want to document the REST API of the application and not necessarily want to expose the documentation of the requests to get HTML pages.

It could be an array with these default values:

sails.config.swagger.route: ['rest', 'shortcuts', 'blueprint_actions', 'manual']

Maybe the options could be limited to ['rest', 'shortcuts', 'actions'] where 'actions' stands for blueprint_actions and manual.

I guess it would be easier to implement this when sails.getRoutes() is available.

tjwebb commented 9 years ago

I think this would be good; a PR would be appreciated.

AlexisNo commented 9 years ago

I would love to work on it! :)

I proposed at small PR on Sails that would make it very easy to implement. This PR would also allow to simplify the current code and to implement many other functionalities (to disable or enrich the documentation for some specific routes for example).

Unfortunately, I don't have feedback about it since three weeks. I guess the core team is very busy nowadays. But as soon as I know if I can rely on that PR, I'll work on it.

Thanks

moisesrodriguez commented 8 years ago

@AlexisNo looks like the PR was merged https://github.com/balderdashy/sails/pull/3326, waiting to see this implemented

AlexisNo commented 8 years ago

@moisesrodriguez Cool ! I will try to find some time to work on it this week.

riemers commented 8 years ago

Looking forward to it, just bumped into it myself too ;)

AlexisNo commented 8 years ago

Sorry, I began to do some refactoring to achieve that, but I think I will need another little modification in the blueprint hook to archive that correctly. And theses days I really had no time to work on it :(

arthur-kv commented 8 years ago

any news about this feature?

krewx commented 8 years ago

+1

varunsingh9 commented 8 years ago

any updates on this ?

lucj commented 8 years ago

Hi, any update ? Is there an option to have only the manual routes to be documented ? Also, any way to remove a whole model documentation to be exposed ?

joseasrocha commented 8 years ago

@lucj I've done some bug fixes and made this available through magik-sails-swagger

Check de Readme and you should get this solved

lucj commented 8 years ago

thanks a lot, I'll check that.

On Wed, Sep 7, 2016 at 4:19 PM, José Rocha notifications@github.com wrote:

@lucj https://github.com/lucj I've done some bug fixes and made this available through magik-sails-swagger https://github.com/Magikevolution/sails-magik-swagger

Check de Readme and you should get this solved

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/langateam/sails-swagger/issues/8#issuecomment-245295409, or mute the thread https://github.com/notifications/unsubscribe-auth/AALIhscNvUmm3Tscl4JCFxAwcgjqy_G7ks5qnsgOgaJpZM4GPzw3 .