lib/json-schema/attributes/enum.rb in json-schema-1.0.12 vs lib/json-schema/attributes/enum.rb in json-schema-1.1.0
- old
+ new
@@ -1,9 +1,9 @@
module JSON
class Schema
class EnumAttribute < Attribute
- def self.validate(current_schema, data, fragments, validator, options = {})
+ def self.validate(current_schema, data, fragments, processor, validator, options = {})
if !current_schema.schema['enum'].include?(data)
message = "The property '#{build_fragment(fragments)}' value #{data.inspect} did not match one of the following values:"
current_schema.schema['enum'].each {|val|
if val.is_a?(NilClass)
message += " null,"
@@ -14,10 +14,10 @@
else
message += " #{val.to_s},"
end
}
message.chop!
- validation_error(message, fragments, current_schema, self, options[:record_errors])
+ validation_error(processor, message, fragments, current_schema, self, options[:record_errors])
end
end
end
end
end
\ No newline at end of file