Match each dosent fail for non existing json path

Yes, this is by design. match each is actually a loop. If the number of items is zero, the match will never be applied.

If you want to ensure that the array needs to be non-empty, add a second check.

* def foo = [1, 2]
* match foo == '#[_ > 0]'
* match each foo == '#number'

Leave a Comment