lib/json-schema/attributes/ref.rb in json-schema-5.0.1 vs lib/json-schema/attributes/ref.rb in json-schema-5.1.0
- old
+ new
@@ -9,11 +9,11 @@
uri, schema = get_referenced_uri_and_schema(current_schema.schema, current_schema, validator)
if schema
schema.validate(data, fragments, processor, options)
elsif uri
- message = "The referenced schema '#{uri.to_s}' cannot be found"
+ message = "The referenced schema '#{uri}' cannot be found"
validation_error(processor, message, fragments, current_schema, self, options[:record_errors])
else
message = "The property '#{build_fragment(fragments)}' was not a valid schema"
validation_error(processor, message, fragments, current_schema, self, options[:record_errors])
end
@@ -42,10 +42,10 @@
else
target_schema = target_schema[fragment]
end
fragment_path = fragment_path + "/#{fragment}"
if target_schema.nil?
- raise SchemaError, "The fragment '#{fragment_path}' does not exist on schema #{ref_schema.uri.to_s}"
+ raise SchemaError, "The fragment '#{fragment_path}' does not exist on schema #{ref_schema.uri}"
end
end
end
# We have the schema finally, build it and validate!