Sha256: 778e578d2e6748d8c874d4fd45f6e0e478add09e4f0ae4fdec76829af7bfec1f
Contents?: true
Size: 610 Bytes
Versions: 6
Compression:
Stored size: 610 Bytes
Contents
require 'json-schema/attributes/format' require 'json-schema/errors/uri_error' module JSON class Schema class UriFormat < FormatAttribute def self.validate(current_schema, data, fragments, processor, validator, options = {}) return unless data.is_a?(String) error_message = "The property '#{build_fragment(fragments)}' must be a valid URI" begin JSON::Util::URI.parse(data) rescue JSON::Schema::UriError validation_error(processor, error_message, fragments, current_schema, self, options[:record_errors]) end end end end end
Version data entries
6 entries across 5 versions & 3 rubygems