Sha256: d9fb1307be02b07f8f3d85f6a150015ff4b5f253846cdfdfe6f1c4eee80d9f4a
Contents?: true
Size: 563 Bytes
Versions: 3
Compression:
Stored size: 563 Bytes
Contents
require 'json-schema/attribute' module JSON class Schema class MinItemsAttribute < Attribute def self.validate(current_schema, data, fragments, processor, validator, options = {}) if data.is_a?(Array) && (data.size < current_schema.schema['minItems']) message = "The property '#{build_fragment(fragments)}' did not contain a minimum number of items #{current_schema.schema['minItems']}" validation_error(processor, message, fragments, current_schema, self, options[:record_errors]) end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
json-schema-2.4.1 | lib/json-schema/attributes/minitems.rb |
json-schema-2.4.0 | lib/json-schema/attributes/minitems.rb |
json-schema-2.3.0 | lib/json-schema/attributes/minitems.rb |