Class: OpenapiValidator::ResponseValidator::ImageValidator
- Inherits:
-
Object
- Object
- OpenapiValidator::ResponseValidator::ImageValidator
- Defined in:
- lib/openapi_validator/response_validators/image_validator.rb
Instance Method Summary collapse
-
#initialize(schema:, data:, fragment:, media_type:, response:) ⇒ ImageValidator
constructor
A new instance of ImageValidator.
- #validate ⇒ Object
Constructor Details
#initialize(schema:, data:, fragment:, media_type:, response:) ⇒ ImageValidator
Returns a new instance of ImageValidator.
4 5 6 7 8 9 10 11 12 |
# File 'lib/openapi_validator/response_validators/image_validator.rb', line 4 def initialize(schema:, data:, fragment:, media_type:, response:) @schema = schema @data = data @fragment = fragment @media_type = media_type @response = response @property_name = JSON::Schema::Attribute.build_fragment([fragment]) @errors = [] end |
Instance Method Details
#validate ⇒ Object
14 15 16 17 18 19 |
# File 'lib/openapi_validator/response_validators/image_validator.rb', line 14 def validate validate_media_type validate_schema @errors end |