Class: SwaggerUiEngineRails7::SwaggerDocsController

Inherits:
ApplicationController show all
Includes:
ConfigParser, OauthConfigParser
Defined in:
app/controllers/swagger_ui_engine_rails7/swagger_docs_controller.rb

Instance Method Summary collapse

Methods included from ConfigParser

#configuration, #set_validator_url, #validator_enabled?

Methods included from AuthConfigParser

#admin_password, #admin_username, #basic_authentication_enabled?, #configuration

Instance Method Details

#indexObject



14
15
16
17
18
# File 'app/controllers/swagger_ui_engine_rails7/swagger_docs_controller.rb', line 14

def index
  # backward compatibility for defining single doc url in strings
  redirect_to single_swagger_doc_path if single_doc_url?
  redirect_to swagger_doc_path(@swagger_url.keys.first) if single_doc_url_hash?
end

#oauth2Object



11
12
# File 'app/controllers/swagger_ui_engine_rails7/swagger_docs_controller.rb', line 11

def oauth2
end

#showObject



20
21
22
23
# File 'app/controllers/swagger_ui_engine_rails7/swagger_docs_controller.rb', line 20

def show
  @single_doc_url = single_doc_url? || single_doc_url_hash?
  @swagger_url = @swagger_url[params[:id].to_sym] unless single_doc_url?
end

#single_docObject



25
26
27
# File 'app/controllers/swagger_ui_engine_rails7/swagger_docs_controller.rb', line 25

def single_doc
  render 'show'
end