Class: OpenapiFirst::ValidationResult
- Inherits:
-
Struct
- Object
- Struct
- OpenapiFirst::ValidationResult
- Defined in:
- lib/openapi_first/validation_result.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#output ⇒ Object
Returns the value of attribute output.
-
#schema ⇒ Object
Returns the value of attribute schema.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#message ⇒ Object
Returns a message that is used in exception messages.
- #valid? ⇒ Boolean
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data
4 5 6 |
# File 'lib/openapi_first/validation_result.rb', line 4 def data @data end |
#output ⇒ Object
Returns the value of attribute output
4 5 6 |
# File 'lib/openapi_first/validation_result.rb', line 4 def output @output end |
#schema ⇒ Object
Returns the value of attribute schema
4 5 6 |
# File 'lib/openapi_first/validation_result.rb', line 4 def schema @schema end |
Instance Method Details
#error? ⇒ Boolean
6 |
# File 'lib/openapi_first/validation_result.rb', line 6 def error? = !output['valid'] |
#message ⇒ Object
Returns a message that is used in exception messages.
9 10 11 12 13 |
# File 'lib/openapi_first/validation_result.rb', line 9 def return if valid? (output['errors']&.map { |e| e['error'] }&.join('. ') || output['error'])&.concat('.') end |
#valid? ⇒ Boolean
5 |
# File 'lib/openapi_first/validation_result.rb', line 5 def valid? = output['valid'] |