richhollis / swagger-docs

Generates swagger-ui json files for Rails APIs with a simple DSL.
MIT License
750 stars 150 forks source link

Missing doc generation from pre-loaded controller #121

Closed frodrigo closed 8 years ago

frodrigo commented 9 years ago

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.

richhollis commented 8 years ago

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!