Class: Rage::OpenAPI::Parsers::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/rage/openapi/parsers/request.rb

Constant Summary collapse

AVAILABLE_PARSERS =
[
  Rage::OpenAPI::Parsers::SharedReference,
  Rage::OpenAPI::Parsers::YAML,
  Rage::OpenAPI::Parsers::Ext::ActiveRecord
]

Class Method Summary collapse

Class Method Details

.parse(request_tag, namespace:) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/rage/openapi/parsers/request.rb', line 10

def self.parse(request_tag, namespace:)
  parser = AVAILABLE_PARSERS.find do |parser_class|
    parser = parser_class.new(namespace:)
    break parser if parser.known_definition?(request_tag)
  end

  parser.parse(request_tag) if parser
end