Class: Committee::Drivers::OpenAPI3::Schema

Inherits:
Schema
  • Object
show all
Defined in:
lib/committee/drivers/open_api_3/schema.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(driver, open_api) ⇒ Schema

Returns a new instance of Schema.



13
14
15
16
# File 'lib/committee/drivers/open_api_3/schema.rb', line 13

def initialize(driver, open_api)
  @open_api = open_api
  @driver = driver
end

Instance Attribute Details

#open_apiOpenAPIParser::Schemas::OpenAPI (readonly)

Returns:

  • (OpenAPIParser::Schemas::OpenAPI)


13
14
15
# File 'lib/committee/drivers/open_api_3/schema.rb', line 13

def open_api
  @open_api
end

#validator_optionObject (readonly)

Returns the value of attribute validator_option.



8
9
10
# File 'lib/committee/drivers/open_api_3/schema.rb', line 8

def validator_option
  @validator_option
end

Instance Method Details

#build_router(options) ⇒ Object



26
27
28
29
# File 'lib/committee/drivers/open_api_3/schema.rb', line 26

def build_router(options)
  @validator_option = Committee::SchemaValidator::Option.new(options, self, :open_api_3)
  Committee::SchemaValidator::OpenAPI3::Router.new(self, @validator_option)
end

#driverObject

we don’t use attr_reader because this method override super class



22
23
24
# File 'lib/committee/drivers/open_api_3/schema.rb', line 22

def driver # we don't use attr_reader because this method override super class
  @driver
end

#operation_object(path, method) ⇒ Object

OpenAPI3 only



32
33
34
35
36
37
# File 'lib/committee/drivers/open_api_3/schema.rb', line 32

def operation_object(path, method)
  request_operation = open_api.request_operation(method, path)
  return nil unless request_operation

  Committee::SchemaValidator::OpenAPI3::OperationWrapper.new(request_operation)
end

#supports_stub?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/committee/drivers/open_api_3/schema.rb', line 18

def supports_stub?
  false
end