title: Validating items inside an array - Symfony 2.1
body: <p>I'm using the Symfony 2.1 validation module to validate data for my REST API, it works correctly but I'm wondering if there is any easy way to validate items inside an array. For example, one of my fields is an array of dates, I want to ensure that each item inside is correctly formatted date. </p>
  
  <p>I am using YAML as follows to set constraints, <code>array_of_dates</code> is the field I'd like to be able to validate each item inside that array to be a valid date.</p>
  
  <pre><code># src/Acme/DemoBundle/Resources/config/validation.yml
  Acme\DemoBundle\Entity\Demo:
      properties:
          start:
              - NotBlank: ~
              - Date: ~
          end:
              - NotBlank: ~
              - Date: ~
          array_of_dates:
              - Type:
                  type: array
  </code></pre>