Exception: OpenAPIParser::ValidateError

Inherits:
OpenAPIError
  • Object
show all
Defined in:
lib/openapi_parser/errors.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, type, reference) ⇒ ValidateError

Returns a new instance of ValidateError.



9
10
11
12
13
# File 'lib/openapi_parser/errors.rb', line 9

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

Parameters:



23
24
25
# File 'lib/openapi_parser/errors.rb', line 23

def build_error_result(value, schema)
  [nil, OpenAPIParser::ValidateError.new(value, schema.type, schema.object_reference)]
end

Instance Method Details

#messageObject



15
16
17
# File 'lib/openapi_parser/errors.rb', line 15

def message
  "#{@data} class is #{@data.class} but it's not valid #{@type} in #{@reference}"
end