richhollis / swagger-docs

Generates swagger-ui json files for Rails APIs with a simple DSL.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing doc generation from pre-loaded controller

frodrigo opened this issue · comments

I have a case where some controllers are loaded before Swagger::Docs::Geneator resulting in use of fake swagger_docs method and no doc generated. I can't postpone Controller declaration because I need to reopen the class to add methods (and swagger_api call).
I'm encounter this case because I'm using rails_engine_decorators. But since controllers are load earlier than Swagger::Docs::Geneator there the problem.

Hey! I'm not familiar with rails_engine_decorators and I'm not really close enough to your code to try anything out. The only thing I can think of is that you find the most appropriate location and timing in your app to somehow call swagger-docs. If you find a way that is something we can reuse then definitely submit a PR and we'll get that merged in. Thanks!