Bug with `maybe(:array).each`

Hey,

I had a quick search and couldn’t see this bug mentioned before.

We’ve been trying to the use the following in our schemas:

required(:foo).maybe(:array).each(:integer)

However, when using input such as { foo: nil } an exception will be raised around trying to call .map on nil.

Are you aware of this bug or shall I raise an issue on GitHub with a proper reproduction?

For now, we’ve had to do the following:

required(:foo).maybe(Types::Array.of(Types::Params::Integer))

Is there a better workaround?

@adamransom sorry for late reply. This does look like a bug - please report it. A shorter workaround would be to do schema { required(:foo).maybe(array[:integer]) }