Class: OpenapiValidator::Validator

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_base_pathObject (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_docObject (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_requestsObject (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

Parameters:

  • request (Array)


22
23
24
# File 'lib/openapi_validator/validator.rb', line 22

def remove_validated_path(request)
  @unvalidated_requests.delete(request)
end

#validate_documentationDocumentationValidator

Returns validation result.

Returns:



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.

Returns:

  • (Object)

    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