Sha256: 9d9b2a995089f2e272d67a6a68fd07b38218cfe5e38afbacc2c4f528ea468b2c
Contents?: true
Size: 513 Bytes
Versions: 15
Compression:
Stored size: 513 Bytes
Contents
module JSON class Schema class MaxLengthAttribute < Attribute def self.validate(current_schema, data, fragments, validator, options = {}) if data.is_a?(String) if data.length > current_schema.schema['maxLength'] message = "The property '#{build_fragment(fragments)}' was not of a maximum string length of #{current_schema.schema['maxLength']}" raise ValidationError.new(message, fragments, current_schema) end end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems