title: How do I include swagger-docs in a controller that inherits from a different base controller?
body: <p>I'm using <a href="https://github.com/richhollis/swagger-docs" rel="nofollow noreferrer">swagger-docs</a> to add documentation to an API, and my configuration looks like this:</p>
  
  <pre><code>Swagger::Docs::Config.register_apis({
    "1.0" =&gt; {
      :api_file_path =&gt; "public/",
      :base_path =&gt; "http://localhost:3000",
      :clean_directory =&gt; true,
      :base_api_controller =&gt; ActionController::API,
      :attributes =&gt; {
        :info =&gt; {
          "title" =&gt; "Test",
          "description" =&gt; "Test",
          "contact" =&gt; "contact@example.com",
          "license" =&gt; "MIT",
          "licenseUrl" =&gt; "https://opensource.org/licenses/MIT"
        }
      }
    }
  })
  </code></pre>
  
  <p>This works ok for controllers that inherit from <code>ActionController::API</code>, but how do I include the DSL methods when a controller inherits from a different base controller? For example, when using the <code>knock</code> gem for authentication:</p>
  
  <pre><code>class Users::AuthenticationController &lt; Knock::AuthTokenController
    swagger_controller :login, "Request a new JWT to issue authenticated requests"
  
    swagger_api :create do
      summary "Generates a JWT to be used for authenticated requests"
      param :email, "auth[email]", :string, :required, "Email for authentication"
      param :password, "auth[password]", :string, :required, "Password for authentication"
      response :created
      response :not_found, "Credentials specified were wrong"
    end
  
    def entity_class
      User
    end
  end
  </code></pre>
  
  <p>This code returns the following error:</p>
  
  <pre><code>undefined method `swagger_controller' for Users::AuthenticationController:Class
  </code></pre>
  
  <p>I tried including the methods using:</p>
  
  <pre><code>include Swagger::Docs::ImpotentMethods
  </code></pre>
  
  <p>But this didn't work, even though it removed the error.</p>