Method: Schemacop::V3::AllOfNode#_validate

Defined in:
lib/schemacop/v3/all_of_node.rb

#_validate(data, result:) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/schemacop/v3/all_of_node.rb', line 8

def _validate(data, result:)
  super_data = super
  return if super_data.nil?

  matches = matches(super_data)

  if matches.size != @items.size
    result.error <<~PLAIN.strip
      Matches #{matches.size} schemas but should match all of them:
      #{schema_messages(data).join("\n")}
    PLAIN
  end
end