lib/json-schema/attributes/enum.rb in json-schema-2.1.6 vs lib/json-schema/attributes/enum.rb in json-schema-2.1.7
- old
+ new
@@ -2,10 +2,10 @@
class Schema
class EnumAttribute < Attribute
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_key {|val|
+ current_schema.schema['enum'].each {|val|
if val.is_a?(NilClass)
message += " null,"
elsif val.is_a?(Array)
message += " (array),"
elsif val.is_a?(Hash)
\ No newline at end of file