title: Symfony3 deserialize multiple entity objects
body: <p>Serialize and deserialize single entity object work properly for me.</p>
  
  <p>It is possible to serialize and deserialize multiple object (array of objects) in this way??</p>
  
  <pre><code>$notifications = $this-&gt;getDoctrine()
      -&gt;getRepository('AppBundle:Notification')
      -&gt;findAll();
  
  $encoder = new JsonEncoder();
  $normalizer = new ObjectNormalizer();
  
  $serializer = new Serializer(array($normalizer), array($encoder));
  $jsonContent = $serializer-&gt;serialize($notifications, 'json');
  
  return new Response($jsonContent);
  </code></pre>
  
  <p>And</p>
  
  <pre><code>$response = curl_exec($ch); // my $jsonContent from previous code
  
  $encoder = new JsonEncoder();
  $normalizer = new ObjectNormalizer();
  
  $serializer = new Serializer(array($normalizer), array($encoder));
  $notifications = $serializer-&gt;deserialize($response, Notification::class, 'json');
  </code></pre>
  
  <p>Then i got:</p>
  
  <blockquote>
    <p>The property path constructor needs a string or an instance of
    "Symfony\Component\PropertyAccess\PropertyPath". Got: "integer" 500
    Internal Server Error - UnexpectedValueException</p>
  </blockquote>