Closed jesmith17 closed 8 years ago
@jesmith17 What was the fix in the end?
@richhollis - I had the same problem. So I added this to my Swagger docs initializer:
class Swagger::Docs::Config
def self.base_api_controller; ApiController end
end
In my case ApiController
inherits from ActionController::API
.
Hey @otobrglez - Are you using Rails API / ActionController::API too?
@richhollis Yes. However later on I found out that this doesen't work as expected. Sometimes in development mode controllers get reloaded and for some reason I also get missing error. So I'm now running this - and it works. With Rails 4 that is.:
module Swagger
module Docs
class Config
def self.base_api_controller
ActionController::API
end
end
end
end
https://github.com/richhollis/swagger-docs/issues/147#issuecomment-337801122 I solved the issue in this way
I am using Rails API, so my ApplicationController extends from ActionController::API
I have added the DSL to the top of one of my controllers
Initializer looks like
(note: I intentionally didn't change it much to make sure it wasn't something I did).
Produces the following output
I assume the API::passwords issues with part of Devise, and am not worried about that.
The only way I can get past this is to either remove the top line of the config where we set the base_api_controller, or to comment out the
line in the controlller.
Then I get
when I execute.
What am i missing here?
Using swagger-docs 0.2.8 and Rails 4.2.5 Rake 11.1.1