Class: OpenapiValidator::ResponseValidator::JsonValidator

Inherits:
Object
  • Object
show all
Defined in:
lib/openapi_validator/response_validators/json_validator.rb

Instance Method Summary collapse

Constructor Details

#initialize(schema:, data:, fragment:, media_type:, response:) ⇒ JsonValidator

Returns a new instance of JsonValidator.



4
5
6
7
8
9
10
# File 'lib/openapi_validator/response_validators/json_validator.rb', line 4

def initialize(schema:, data:, fragment:, media_type:, response:)
  @schema = schema
  @data = data
  @fragment = fragment
  @media_type = media_type
  @response = response
end

Instance Method Details

#validateObject



12
13
14
# File 'lib/openapi_validator/response_validators/json_validator.rb', line 12

def validate
  OpenapiValidator::JsonValidator.fully_validate(schema, data, fragment: fragment, response: response)
end