Class: OpenapiFirst::Schema::Result
- Inherits:
-
Struct
- Object
- Struct
- OpenapiFirst::Schema::Result
- Defined in:
- lib/openapi_first/definition/schema/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
5 6 7 |
# File 'lib/openapi_first/definition/schema/result.rb', line 5 def data @data end |
#output ⇒ Object
Returns the value of attribute output
5 6 7 |
# File 'lib/openapi_first/definition/schema/result.rb', line 5 def output @output end |
#schema ⇒ Object
Returns the value of attribute schema
5 6 7 |
# File 'lib/openapi_first/definition/schema/result.rb', line 5 def schema @schema end |
Instance Method Details
#error? ⇒ Boolean
7 |
# File 'lib/openapi_first/definition/schema/result.rb', line 7 def error? = !output['valid'] |
#message ⇒ Object
Returns a message that is used in exception messages.
10 11 12 13 14 |
# File 'lib/openapi_first/definition/schema/result.rb', line 10 def return if valid? (output['errors']&.map { |e| e['error'] }&.join('. ') || output['error']) end |
#valid? ⇒ Boolean
6 |
# File 'lib/openapi_first/definition/schema/result.rb', line 6 def valid? = output['valid'] |