Sha256: 98d5d95f42ee06e025a15aa6814a1d312512b8a8ae4477a7ebb1adb80c556117
Contents?: true
Size: 545 Bytes
Versions: 10
Compression:
Stored size: 545 Bytes
Contents
require 'json-schema/attribute' module JSON class Schema class DateTimeV4Format < FormatAttribute def self.validate(current_schema, data, fragments, processor, validator, options = {}) return unless data.is_a?(String) DateTime.rfc3339(data) rescue ArgumentError error_message = "The property '#{build_fragment(fragments)}' must be a valid RFC3339 date/time string" validation_error(processor, error_message, fragments, current_schema, self, options[:record_errors]) end end end end
Version data entries
10 entries across 10 versions & 2 rubygems