Swagger - a great tool for documentation your API’s - you can read more at official Github account.
I decided to implement it into my Evendy project - it’s a web application for events organizing for me and my friends.
First of all let’s add submodule with swagger-ui tool into project’s ‘public’ directory.
Great, then add new route into our routes.rb file:
Excellent, now we need to describe our API, and add some configuration parameters. Let’s create initializer swagger.rb:
Then into our BaseController, to use DRY declaration:
And final step - our API definition in CategoriesController:
Then just go to the your url and /docs.