Sha256: cc2d9fed8a0af3a2570a9c9171a2fbc14dcb2237ce507c69da319c9c5227471b
Contents?: true
Size: 480 Bytes
Versions: 15
Compression:
Stored size: 480 Bytes
Contents
module JSON class Schema class UniqueItemsAttribute < Attribute def self.validate(current_schema, data, fragments, validator, options = {}) if data.is_a?(Array) d = data.clone dupes = d.uniq! if dupes message = "The property '#{build_fragment(fragments)}' contained duplicated array values" raise ValidationError.new(message, fragments, current_schema) end end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems