Class: Swaggard::SwaggerController

Inherits:
ApplicationController show all
Defined in:
app/controllers/swaggard/swagger_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/swaggard/swagger_controller.rb', line 6

def index
  respond_to do |format|
    format.html do
      @authentication_type = Swaggard.configuration.authentication_type
      @authentication_key = Swaggard.configuration.authentication_key
      @authentication_value = Swaggard.configuration.authentication_value.respond_to?(:call) ?
                                Swaggard.configuration.authentication_value.call :
                                Swaggard.configuration.authentication_value

      render :index, layout: false
    end

    format.json do
      render json: get_swaggard_doc_json
    end
  end
end