Class: OpenapiValidator::Validator
- Inherits:
-
Object
- Object
- OpenapiValidator::Validator
- Defined in:
- lib/openapi_validator/validator.rb
Instance Attribute Summary collapse
-
#api_base_path ⇒ Object
readonly
Returns the value of attribute api_base_path.
-
#api_doc ⇒ Object
readonly
Returns the value of attribute api_doc.
-
#unvalidated_requests ⇒ Object
readonly
Returns the value of attribute unvalidated_requests.
Instance Method Summary collapse
- #remove_validated_path(request) ⇒ Object
-
#validate_documentation ⇒ DocumentationValidator
Validation result.
-
#validate_request(**params) ⇒ Object
RequestValidator.
Instance Attribute Details
#api_base_path ⇒ Object (readonly)
Returns the value of attribute api_base_path.
9 10 11 |
# File 'lib/openapi_validator/validator.rb', line 9 def api_base_path @api_base_path end |
#api_doc ⇒ Object (readonly)
Returns the value of attribute api_doc.
9 10 11 |
# File 'lib/openapi_validator/validator.rb', line 9 def api_doc @api_doc end |
#unvalidated_requests ⇒ Object (readonly)
Returns the value of attribute unvalidated_requests.
9 10 11 |
# File 'lib/openapi_validator/validator.rb', line 9 def unvalidated_requests @unvalidated_requests end |
Instance Method Details
#remove_validated_path(request) ⇒ Object
22 23 24 |
# File 'lib/openapi_validator/validator.rb', line 22 def remove_validated_path(request) @unvalidated_requests.delete(request) end |
#validate_documentation ⇒ DocumentationValidator
Returns validation result.
12 13 14 |
# File 'lib/openapi_validator/validator.rb', line 12 def validate_documentation DocumentationValidator.call(api_doc, additional_schemas: additional_schemas) end |
#validate_request(**params) ⇒ Object
Returns RequestValidator.
17 18 19 |
# File 'lib/openapi_validator/validator.rb', line 17 def validate_request(**params) RequestValidator.call(request: Request.call(**params), validator: self) end |