Sha256: b785db58c4a377283efe06c6cf4827c007e668af87fcc2d65c1505c97f3ace16
Contents?: true
Size: 634 Bytes
Versions: 36
Compression:
Stored size: 634 Bytes
Contents
module Schemacop module V3 class IsNotNode < CombinationNode def type :not end def _validate(data, result:) super_data = super return if super_data.nil? if matches(super_data).any? result.error "Must not match schema: #{@items.first.as_json.as_json.inspect}." end end def as_json process_json([], type => @items.first.as_json) end def validate_self if @items.count != 1 fail 'Node "is_not" only allows exactly one item.' end end def cast(data) data end end end end
Version data entries
36 entries across 36 versions & 1 rubygems