richhollis / swagger-docs

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

Configurations with rails 6 #184

Closed AstmDesign closed 3 years ago

AstmDesign commented 4 years ago

Guys, I'm usually using swagger-docs with rails 5 and it working well with me and using the swagger-ui with it https://github.com/richhollis/swagger-docs-sample but now I'm installed swagger-docs & swagger-ui for application built with rails 6.0.3.2 and configured everything well as rails 5 but after running the command rake swagger:docs it's giving me V1: 0 processed why it's not reading my api's? Does it need any other Gem to add with rails 6 such as rswag Gem?

AstmDesign commented 3 years ago

I fixed it by adding in the initializer Swagger::Docs::Config.register_apis this line :base_api_controller => ActionController::API, instead of :parent_controller => Api::V1::BaseApiController,
And it working well now with me Rails 6