ruby-json-schema/json-schema

View on GitHub
lib/json-schema/attributes/disallow.rb

Summary

Maintainability
A
45 mins
Test Coverage
require 'json-schema/attribute'

module JSON
  class Schema
    class DisallowAttribute < Attribute
      def self.validate(current_schema, data, fragments, processor, validator, options = {})
        return unless type = validator.attributes['type']

        type.validate(current_schema, data, fragments, processor, validator, options.merge(disallow: true))
      end
    end
  end
end