lib/schemacop/v3/combination_node.rb in schemacop-3.0.19 vs lib/schemacop/v3/combination_node.rb in schemacop-3.0.20
- old
+ new
@@ -38,8 +38,21 @@
end
def matches(data)
@items.select { |i| item_matches?(i, data) }
end
+
+ def schema_messages(data)
+ return @items.each_with_index.map do |item, index|
+ item_result = Result.new(self)
+ item._validate(data, result: item_result)
+ if item_result.valid?
+ " - Schema #{index + 1}: Matches"
+ else
+ message = " - Schema #{index + 1}:\n"
+ message << item_result.messages(pad: 4, itemize: true).join("\n")
+ end
+ end
+ end
end
end
end