Class: Apicasso::ApidocsController
- Inherits:
-
ApplicationController
- Object
- ActionController::API
- ApplicationController
- Apicasso::ApidocsController
- Includes:
- Swagger::Blocks
- Defined in:
- app/controllers/apicasso/apidocs_controller.rb
Overview
Controller used to generate an application Swagger JSON, used by SwaggerUI to generate beautiful API documentation
Constant Summary collapse
- SWAGGERED_CLASSES =
A list of all classes that have swagger_* declarations, which gets injected by this gem in all ‘ActiveRecord::Base` classes
[ *ActiveRecord::Base.descendants, self ].freeze
- ASSOCIATION_EXCLUDED =
[ 'ActiveStorage::Attachment', 'ActiveStorage::Blob' ].freeze
Instance Method Summary collapse
-
#index ⇒ Object
Method that serves the generated Swagger JSON.
Methods inherited from ApplicationController
Instance Method Details
#index ⇒ Object
Method that serves the generated Swagger JSON
506 507 508 |
# File 'app/controllers/apicasso/apidocs_controller.rb', line 506 def index render json: Swagger::Blocks.build_root_json(SWAGGERED_CLASSES).to_json end |