Class: Openapi3Parser::NodeFactory::MediaType::EncodingValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/openapi3_parser/node_factory/media_type.rb

Instance Method Summary collapse

Constructor Details

#initialize(factory) ⇒ EncodingValidator

Returns a new instance of EncodingValidator.


44
45
46
# File 'lib/openapi3_parser/node_factory/media_type.rb', line 44

def initialize(factory)
  @factory = factory
end

Instance Method Details

#call(validatable) ⇒ Object


48
49
50
51
52
53
# File 'lib/openapi3_parser/node_factory/media_type.rb', line 48

def call(validatable)
  missing_keys = validatable.input.keys - properties
  return if missing_keys.empty?

  validatable.add_error(error_message(missing_keys))
end