livingsocial / swagger_yard

Swagger-UI compliant JSON generated from YARD. For RESTful Rails apps.
MIT License
51 stars 28 forks source link

Remove configuration layer #72

Open StefSchenkelaars opened 3 years ago

StefSchenkelaars commented 3 years ago

We have an application with multiple API definitions in the same codebase. Therefore we would like to be able to generate multiple specifications with different settings. This is doable but I think this flow could be improved by removing the configuration or specification layer. Let me explain.

Currently the library uses global settings which are defined in the Configuration class. Then some local configuration can be passed to the Specification class but not everything can be overwritten. Next to this, the parsing is depending on the configuration settings which makes the dependency tree quite complex.

My proposal is therefore to make merge the Configuration and Specification class. This object then defines all the settings needed throughout the modules. The Swagger and OpenAPI classes should then receive an instance of this class as an argument which completely defines all parsing and processing settings.

@nicksieger Do you think it's worth it to spend the time on this?