Class: SwaggerDocsRails::SwaggerController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- SwaggerDocsRails::SwaggerController
- Defined in:
- app/controllers/swagger_docs_rails/swagger_controller.rb
Constant Summary collapse
- SWAGGER_UI_CDN =
"https://cdn.jsdelivr.net/npm/swagger-ui-dist@5"
Class Attribute Summary collapse
-
.cached_doc ⇒ Object
Returns the value of attribute cached_doc.
Instance Method Summary collapse
Class Attribute Details
.cached_doc ⇒ Object
Returns the value of attribute cached_doc.
23 24 25 |
# File 'app/controllers/swagger_docs_rails/swagger_controller.rb', line 23 def cached_doc @cached_doc end |
Instance Method Details
#doc ⇒ Object
13 14 15 |
# File 'app/controllers/swagger_docs_rails/swagger_controller.rb', line 13 def doc render json: JSON.parse(build_doc(resolved_server_url)) end |
#reset ⇒ Object
17 18 19 20 |
# File 'app/controllers/swagger_docs_rails/swagger_controller.rb', line 17 def reset self.class.cached_doc = nil render json: { message: "Cache do Swagger limpo. Acesse /swagger para regenerar." }, status: :ok end |
#ui ⇒ Object
9 10 11 |
# File 'app/controllers/swagger_docs_rails/swagger_controller.rb', line 9 def ui render html: html_page.html_safe, layout: false end |