Module: Modern::DocGenerator::OpenAPI3::Paths

Includes:
Operations
Included in:
Modern::DocGenerator::OpenAPI3
Defined in:
lib/modern/doc_generator/open_api3/paths.rb

Instance Method Summary collapse

Methods included from Operations

#_operation, #_parameter, #_request_body, #_response, #_security_requirement

Instance Method Details

#_paths(descriptor) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/modern/doc_generator/open_api3/paths.rb', line 11

def _paths(descriptor)
  descriptor.routes_by_path.map do |path, routes_by_method|
    [
      path,
      routes_by_method.map do |method, route|
        [method.downcase, _operation(route)]
      end.to_h
    ]
  end.to_h
end