# File lib/grape/validations/validators/base.rb, line 37
      def validate!(params)
        attributes = AttributesIterator.new(self, @scope, params)
        array_errors = []
        attributes.each do |resource_params, attr_name|
          next if !@scope.required? && resource_params.empty?
          next unless @required || (resource_params.respond_to?(:key?) && resource_params.key?(attr_name))
          next unless @scope.meets_dependency?(resource_params, params)

          begin
            validate_param!(attr_name, resource_params)
          rescue Grape::Exceptions::Validation => e
            # we collect errors inside array because
            # there may be more than one error per field
            array_errors << e
          end
        end

        raise Grape::Exceptions::ValidationArrayErrors, array_errors if array_errors.any?
      end