Class: OpenApi::Rswag::Specs::ResponseValidator
- Inherits:
-
Object
- Object
- OpenApi::Rswag::Specs::ResponseValidator
- Defined in:
- lib/open_api/rswag/specs/response_validator.rb
Instance Method Summary collapse
-
#initialize(config = ::OpenApi::Rswag::Specs.config) ⇒ ResponseValidator
constructor
A new instance of ResponseValidator.
- #validate!(metadata, response) ⇒ Object
Constructor Details
#initialize(config = ::OpenApi::Rswag::Specs.config) ⇒ ResponseValidator
Returns a new instance of ResponseValidator.
12 13 14 |
# File 'lib/open_api/rswag/specs/response_validator.rb', line 12 def initialize(config = ::OpenApi::Rswag::Specs.config) @config = config end |
Instance Method Details
#validate!(metadata, response) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/open_api/rswag/specs/response_validator.rb', line 16 def validate!(, response) swagger_doc = @config.get_swagger_doc([:swagger_doc]) validate_code!(, response) validate_headers!(, response.headers) validate_body!(, swagger_doc, response.body) end |