Class: OpenapiRuby::SchemasController

Inherits:
ActionController::API
  • Object
show all
Defined in:
app/controllers/openapi_ruby/schemas_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



13
14
15
# File 'app/controllers/openapi_ruby/schemas_controller.rb', line 13

def index
  render json: {schemas: Serving.schema_names}
end

#showObject



5
6
7
8
9
10
11
# File 'app/controllers/openapi_ruby/schemas_controller.rb', line 5

def show
  document = Serving.schema_document(params[:id], request: request)
  return head :not_found unless document

  content, content_type = document
  render plain: content, content_type: content_type
end