Make validate_required check for empty arrays and arrays containing only...

... empty elements. Fixes #389