Class: Eazypi::PathItem

Inherits:
Object
  • Object
show all
Includes:
SpecObject
Defined in:
lib/eazypi/path_item.rb

Overview

OpenAPI spec PathItemObject

Instance Method Summary collapse

Methods included from SpecObject

included, #initialize, #load

Instance Method Details

#to_openapi_specObject

rubocop:disable Metrics/PerceivedComplexity, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/AbcSize



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/eazypi/path_item.rb', line 20

def to_openapi_spec # rubocop:disable Metrics/PerceivedComplexity, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/AbcSize
  {
    "summary" => summary,
    "description" => description,
    "get" => get&.to_openapi_spec,
    "put" => put&.to_openapi_spec,
    "post" => post&.to_openapi_spec,
    "delete" => delete&.to_openapi_spec,
    "options" => options&.to_openapi_spec,
    "head" => head&.to_openapi_spec,
    "patch" => patch&.to_openapi_spec,
    "trace" => trace&.to_openapi_spec
  }.compact
end