Class: Admin::ApiDocsController

Inherits:
BaseController
  • Object
show all
Defined in:
lib/generators/open_loam/install/templates/admin/api_docs_controller.rb

Overview

A server-rendered OpenAPI explorer for the app's JSON API (OpenLoam::OpenApi) — manager-only. HTML lists the endpoints, their auth, params, and schemas; the .json format serves the raw OpenAPI 3.1 document for tooling. No external JS / Swagger-UI (CSP-safe): the explorer is plain server-rendered HTML.

Constant Summary

Constants included from Pagination

Pagination::PER_PAGE

Instance Method Summary collapse

Methods inherited from BaseController

skip_authorization!

Methods included from Pagination

#paginate

Instance Method Details

#index ⇒ Object



9
10
11
12
13
14
15
# File 'lib/generators/open_loam/install/templates/admin/api_docs_controller.rb', line 9

def index
  @doc = OpenLoam::OpenApi.document
  respond_to do |format|
    format.html
    format.json { render json: @doc }
  end
end