Sha256: 0b9a459ee46284d436109b5903e849094dc374017635cfaa8b4f9a6b929476cc
Contents?: true
Size: 594 Bytes
Versions: 26
Compression:
Stored size: 594 Bytes
Contents
module JSON class Schema class PatternAttribute < Attribute def self.validate(current_schema, data, fragments, processor, validator, options = {}) if data.is_a?(String) r = Regexp.new(current_schema.schema['pattern']) if (r.match(data)).nil? message = "The property '#{build_fragment(fragments)}' value #{data.inspect} did not match the regex '#{current_schema.schema['pattern']}'" validation_error(processor, message, fragments, current_schema, self, options[:record_errors]) end end end end end end
Version data entries
26 entries across 26 versions & 1 rubygems