Description
I would like to start a discussion about this gem's structure. At this stage this gem consist of a single file with a single method add_swagger_documentation. This methods creates a documentation class and adds all api documentation endpoints to it. At this stage all methods on api declaration, endpoints, parameters, models are in one single file now.
What is suggest is to divide logic a bit more into classes or modules with structure corresponding to the swagger spec. This has the advantage that you can separate logic into places where it belongs.
It improves readability and testability of your code. When editing the parameter module you are sure you are not accidentally editing api information. Since you have a little bit more methods defined, you might also be able to add an unit test for your method instead of only integration tests.
Last point is that variables are on their local scope, currently you can declare a variable somewhere on top and use it on line nr 200.
What do you all think of this?