Class: Committee::SchemaValidator::OpenAPI3::ResponseValidator
- Inherits:
-
Object
- Object
- Committee::SchemaValidator::OpenAPI3::ResponseValidator
- Defined in:
- lib/committee/schema_validator/open_api_3/response_validator.rb
Instance Attribute Summary collapse
-
#validate_success_only ⇒ Object
readonly
Returns the value of attribute validate_success_only.
Instance Method Summary collapse
- #call(status, headers, response_data, strict) ⇒ Object
-
#initialize(operation_wrapper, validator_option) ⇒ ResponseValidator
constructor
A new instance of ResponseValidator.
Constructor Details
#initialize(operation_wrapper, validator_option) ⇒ ResponseValidator
Returns a new instance of ResponseValidator.
11 12 13 14 15 |
# File 'lib/committee/schema_validator/open_api_3/response_validator.rb', line 11 def initialize(operation_wrapper, validator_option) @operation_wrapper = operation_wrapper @validate_success_only = validator_option.validate_success_only @check_header = validator_option.check_header end |
Instance Attribute Details
#validate_success_only ⇒ Object (readonly)
Returns the value of attribute validate_success_only.
7 8 9 |
# File 'lib/committee/schema_validator/open_api_3/response_validator.rb', line 7 def validate_success_only @validate_success_only end |
Instance Method Details
#call(status, headers, response_data, strict) ⇒ Object
17 18 19 20 21 |
# File 'lib/committee/schema_validator/open_api_3/response_validator.rb', line 17 def call(status, headers, response_data, strict) return unless Committee::Middleware::ResponseValidation.validate?(status, validate_success_only) operation_wrapper.validate_response_params(status, headers, response_data, strict, check_header) end |