Sha256: 4652c7ded9915371b9fac7404a5fc4d1898fb1b0b573be74f1a9d4666ebee504
Contents?: true
Size: 683 Bytes
Versions: 15
Compression:
Stored size: 683 Bytes
Contents
module JSON class Schema class MaximumAttribute < Attribute def self.validate(current_schema, data, fragments, validator, options = {}) if data.is_a?(Numeric) if (current_schema.schema['exclusiveMaximum'] ? data >= current_schema.schema['maximum'] : data > current_schema.schema['maximum']) message = "The property '#{build_fragment(fragments)}' did not have a maximum value of #{current_schema.schema['maximum']}, " message += current_schema.schema['exclusiveMaximum'] ? 'exclusively' : 'inclusively' raise ValidationError.new(message, fragments, current_schema) end end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems