Exception: OpenAPIParser::ValidateError
- Inherits:
-
OpenAPIError
- Object
- StandardError
- OpenAPIError
- OpenAPIParser::ValidateError
- Defined in:
- lib/openapi_parser/errors.rb
Class Method Summary collapse
-
.build_error_result(value, schema) ⇒ Object
create ValidateError for SchemaValidator return data.
Instance Method Summary collapse
-
#initialize(data, type, reference) ⇒ ValidateError
constructor
A new instance of ValidateError.
- #message ⇒ Object
Constructor Details
#initialize(data, type, reference) ⇒ ValidateError
Returns a new instance of ValidateError.
15 16 17 18 19 |
# File 'lib/openapi_parser/errors.rb', line 15 def initialize(data, type, reference) super(reference) @data = data @type = type end |
Class Method Details
.build_error_result(value, schema) ⇒ Object
create ValidateError for SchemaValidator return data
29 30 31 |
# File 'lib/openapi_parser/errors.rb', line 29 def build_error_result(value, schema) [nil, OpenAPIParser::ValidateError.new(value, schema.type, schema.object_reference)] end |
Instance Method Details
#message ⇒ Object
21 22 23 |
# File 'lib/openapi_parser/errors.rb', line 21 def "#{@reference} expected #{@type}, but received #{@data.class}: #{@data.inspect}" end |