title: Symfony2 validator, NotBlank but allow null
body: <p>I'm having trouble validating a value to allow NULL but not an empty string with the Symfony2 validator component.</p>
  
  <p>I've integrated the component in a Silex application and used the Property Constraint target to validate some properties of my Application Entities (not a Doctrine Entity).</p>
  
  <p>I've added this static method to my Entity class to validate name and service_id on my Entity, problem is that when <code>service_id</code> is NULL which should be valid the <code>NotBlank</code> constraint kicks in and reports a violation. </p>
  
  <pre><code>static public function loadValidatorMetadata(ClassMetadata $metadata)
  {
      // name should never be NULL or a blank string
      $metadata-&gt;addPropertyConstraint('name', new Assert\NotNull());
      $metadata-&gt;addPropertyConstraint('name', new Assert\NotBlank());
  
      // service_id should either be a non-blank string or NULL
      $metadata-&gt;addPropertyConstraint('service_id', new Assert\NotBlank());
  }
  </code></pre>
  
  <p>Bottomline, I'm looking how to allow either a String or NULL as <code>service_id</code> but not allow an empty string.</p>
  
  <p>PS: I've also tried the <code>MinLength(1)</code> constraint but that allows empty strings unfortunately.</p>