Sha256: 8817386eda3019ede68ce9e69ecd263380be372114d21e8a250dcdf317abd769

Contents?: true

Size: 512 Bytes

Versions: 16

Compression:

Stored size: 512 Bytes

Contents

require 'json-schema/attribute'

module JSON
  class Schema
    class FormatAttribute < Attribute
      def self.validate(current_schema, data, fragments, processor, validator, options = {})
        return unless data_valid_for_type?(data, current_schema.schema['type'])
        format = current_schema.schema['format'].to_s
        validator = validator.formats[format]
        validator.validate(current_schema, data, fragments, processor, validator, options) unless validator.nil?
      end
    end
  end
end

Version data entries

16 entries across 15 versions & 4 rubygems

Version Path
json-schema-ouidou-2.9.1 lib/json-schema/attributes/format.rb
json-schema-ouidou-2.9.0 lib/json-schema/attributes/format.rb
json-schema-3.0.0 lib/json-schema/attributes/format.rb
mountapi-0.11.1 vendor/json-schema/lib/json-schema/attributes/format.rb
mountapi-0.11.1 vendor/bundle/ruby/2.7.0/bundler/gems/json-schema-2253a5ee6679/lib/json-schema/attributes/format.rb
json-schema-2.8.1 lib/json-schema/attributes/format.rb
json-schema-2.8.0 lib/json-schema/attributes/format.rb
json-schema-2.7.0 lib/json-schema/attributes/format.rb
json-schema-2.6.2 lib/json-schema/attributes/format.rb
json-schema-2.6.1 lib/json-schema/attributes/format.rb
json-schema-2.6.0 lib/json-schema/attributes/format.rb
json-schema-2.5.2 lib/json-schema/attributes/format.rb
json-schema-openc-fork-0.0.2 lib/json-schema/attributes/format.rb
json-schema-2.5.1 lib/json-schema/attributes/format.rb
json-schema-openc-fork-0.0.1 lib/json-schema/attributes/format.rb
json-schema-2.5.0 lib/json-schema/attributes/format.rb