Class: OpenapiFirst::Schema::ValidationError

Inherits:
Object
  • Object
show all
Defined in:
lib/openapi_first/schema/validation_error.rb

Overview

One of multiple validation errors. Returned by Schema::ValidationResult#errors.

Instance Method Summary collapse

Constructor Details

#initialize(json_schemer_error) ⇒ ValidationError

Returns a new instance of ValidationError.



7
8
9
# File 'lib/openapi_first/schema/validation_error.rb', line 7

def initialize(json_schemer_error)
  @error = json_schemer_error
end

Instance Method Details

#detailsObject



17
# File 'lib/openapi_first/schema/validation_error.rb', line 17

def details = @error['details']

#errorObject Also known as: message



11
# File 'lib/openapi_first/schema/validation_error.rb', line 11

def error = @error['error']

#instance_locationObject



14
# File 'lib/openapi_first/schema/validation_error.rb', line 14

def instance_location = @error['data_pointer']

#schema_locationObject



15
# File 'lib/openapi_first/schema/validation_error.rb', line 15

def schema_location = @error['schema_pointer']

#schemer_errorObject



13
# File 'lib/openapi_first/schema/validation_error.rb', line 13

def schemer_error = @error

#typeObject



16
# File 'lib/openapi_first/schema/validation_error.rb', line 16

def type = @error['type']