Bug with `maybe(:array).each`


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:


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:


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]) }