Validate array items against multiple possible schemas

Hey guys, should the following not be possible? What do I do wrong?

type_a = Dry::Validation.JSON do
  required(:type).filled(format?: /\AA\z/)

type_b = Dry::Validation.JSON do
  required(:type).filled(format?: /\AB\z/) 

schema = Dry::Validation.JSON do
  required(:data).each { schema(type_a) | schema(type_b) }

input = {
  data: [
    { type: 'A' },
    { type: 'B' },
    { type: 'C' }
NoMethodError: undefined method `path' for #<Array:0x00000001eecd60>

Seems like an array is being passed to the message class

dry-validation-0.10.3/lib/dry/validation/message.rb:24:in `initialize'

And it tries to call path on the array. Of course this only happens in the case when the input is invalid.

Please report an issue. This is not yet supported but I plan to make it work before 1.0.0.

I am trying to validate on members of array with different types, and upon searching this forum I found this answer.

Implementing similar solution, I am getting:

undefined method `to_or’ for #Array:…

Is there already a working convention how to validate array with multiple possible schemas?

Thank you,