Class: OpenAPIParser::Schemas::OpenAPI

Inherits:
Base
  • Object
show all
Defined in:
lib/openapi_parser/schemas/classes.rb,
lib/openapi_parser/schemas/openapi.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#object_reference, #parent, #raw_schema, #root

Instance Method Summary collapse

Methods inherited from Base

#after_init, #inspect

Methods included from Expandable

#expand_reference

Methods included from Findable

#find_object, #purge_object_cache

Methods included from Parser

#_openapi_all_child_objects, #_update_child_object, included, #load_data

Constructor Details

#initialize(raw_schema, config) ⇒ OpenAPI

Returns a new instance of OpenAPI.



8
9
10
11
12
13
# File 'lib/openapi_parser/schemas/openapi.rb', line 8

def initialize(raw_schema, config)
  super('#', nil, self, raw_schema)
  @find_object_cache = {}
  @path_item_finder = OpenAPIParser::PathItemFinder.new(paths) if paths # invalid definition
  @config = config
end

Instance Attribute Details

#componentsComponents? (readonly)

Returns:



25
# File 'lib/openapi_parser/schemas/openapi.rb', line 25

openapi_attr_object :components, Components, reference: false

#openapiString? (readonly)

Returns:

  • (String, nil)


17
# File 'lib/openapi_parser/schemas/openapi.rb', line 17

openapi_attr_values :openapi

#pathsPaths? (readonly)

Returns:



21
# File 'lib/openapi_parser/schemas/openapi.rb', line 21

openapi_attr_object :paths, Paths, reference: false

Instance Method Details

#request_operation(http_method, request_path) ⇒ OpenAPIParser::RequestOperation?



28
29
30
# File 'lib/openapi_parser/schemas/openapi.rb', line 28

def request_operation(http_method, request_path)
  OpenAPIParser::RequestOperation.create(http_method, request_path, @path_item_finder, @config)
end