Class: Symphonia::ApiController
Constant Summary
collapse
- SWAGGERED_CLASSES =
A list of all classes that have swagger_* declarations.
[
UsersController,
User,
Swagger::ErrorModel,
]
Class Method Summary
collapse
Instance Method Summary
collapse
#admin_require, #authorize, #back_url, #current_user, #current_user_session, #handle_unverified_request, #login_require, #menu_item, #redirect_back_or_default, #redirect_to_referer_or, #render_403, #render_404, #render_api_head, #render_api_ok, #set_default_locale, #set_locale, #store_location
Class Method Details
.add_tag(name:, description:) ⇒ Object
50
51
52
|
# File 'app/controllers/symphonia/api_controller.rb', line 50
def self.add_tag(name:, description:)
swagger_root_node.tag name: name, description: description
end
|
.api_description=(text) ⇒ Object
66
67
68
|
# File 'app/controllers/symphonia/api_controller.rb', line 66
def self.api_description=(text)
swagger_root_node.data[:info].data[:description] = text
end
|
.api_title=(text) ⇒ Object
61
62
63
|
# File 'app/controllers/symphonia/api_controller.rb', line 61
def self.api_title=(text)
swagger_root_node.data[:info].data[:title] = text
end
|
.swagger_root_node ⇒ Swagger::Blocks::Nodes::RootNode
55
56
57
58
|
# File 'app/controllers/symphonia/api_controller.rb', line 55
def self.swagger_root_node
node = Symphonia::ApiController.send(:_swagger_nodes)
node[:root_node]
end
|
Instance Method Details
70
71
72
73
74
75
76
|
# File 'app/controllers/symphonia/api_controller.rb', line 70
def index
json = ::Swagger::Blocks.build_root_json(self.class.for_documentation + [self.class])
respond_to do |format|
format.yaml { render plain: json.deep_stringify_keys.to_yaml }
format.json { render json: json }
end
end
|