Sha256: 491410135c6dcf77f7e88f9c8e5eb6b5ea480acac2854a6381c32f7fafbf0d5d
Contents?: true
Size: 569 Bytes
Versions: 4
Compression:
Stored size: 569 Bytes
Contents
require 'json-schema/attribute' module JSON class Schema class UniqueItemsAttribute < Attribute def self.validate(current_schema, data, fragments, processor, validator, options = {}) return unless data.is_a?(Array) if data.clone.uniq! message = "The property '#{build_fragment(fragments)}' contained duplicated array values" validation_error(processor, message, fragments, current_schema, self, options[:record_errors]) end end def self.validate_on_false? false end end end end
Version data entries
4 entries across 3 versions & 2 rubygems