Sha256: 2ccb1aee044a68bd728fc4fbe4cd31863ae5f79dbe207fc702acfd730b7f2961
Contents?: true
Size: 553 Bytes
Versions: 6
Compression:
Stored size: 553 Bytes
Contents
require 'json-schema/attributes/format' 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
6 entries across 5 versions & 3 rubygems