Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Include schema in error output for invalid schemas.

  • Loading branch information...
commit 03c90c570668eeb077e546ee65e4fac4a3472e97 1 parent 3c85b18
@myronmarston myronmarston authored
Showing with 2 additions and 2 deletions.
  1. +1 −1  lib/interpol/endpoint.rb
  2. +1 −1  spec/unit/interpol/endpoint_spec.rb
View
2  lib/interpol/endpoint.rb
@@ -214,7 +214,7 @@ def endpoint_name
def validate_data!(data)
errors = ::JSON::Validator.fully_validate_schema(schema)
- raise ValidationError.new(errors, nil, description) if errors.any?
+ raise ValidationError.new(errors, schema, description) if errors.any?
errors = ::JSON::Validator.fully_validate(schema, data)
raise ValidationError.new(errors, data, description) if errors.any?
end
View
2  spec/unit/interpol/endpoint_spec.rb
@@ -331,7 +331,7 @@ def new_with(hash)
schema['properties']['foo']['minItems'] = 'foo'
expect {
subject.validate_data!('foo' => 17)
- }.to raise_error(ValidationError)
+ }.to raise_error(ValidationError, /Data:\s+{"type"=>"object"/m)
end
it 'rejects unrecognized data types' do
Please sign in to comment.
Something went wrong with that request. Please try again.