Class: Eazypi::MediaType

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

Overview

OpenaAPI spec MediaTypeObject

Instance Method Summary collapse

Methods included from SpecObject

included, #initialize, #load

Instance Method Details

#collect_components(schemas: nil, **kwargs) ⇒ Object



10
11
12
13
14
15
# File 'lib/eazypi/media_type.rb', line 10

def collect_components(schemas: nil, **kwargs)
  return unless schema

  schema.collect_components(schemas: schemas, **kwargs)
  schemas&.call(schema)
end

#to_openapi_specObject



17
18
19
20
21
# File 'lib/eazypi/media_type.rb', line 17

def to_openapi_spec
  {
    "schema" => schema.to_openapi_spec
  }
end