I already deserialize into a array of object with :
$encoders = [new JsonEncoder()];
$normalizers = [new ObjectNormalizer(), new GetSetMethodNormalizer(), new ArrayDenormalizer()];
$serializer = new Serializer($normalizers, $encoders);
$clients = $serializer->deserialize($myJson, 'App\Entity\Client[]', 'json');
And also deserialize one entity into existing one (to no INSERT but UPDATE in db) :
$clientDb = $clientRepository->find(1);
$client = $serializer->deserialize($myJson, Client::class, 'json', [AbstractNormalizer::OBJECT_TO_POPULATE => $clientDb ]);
But when I want to do both, doctrine only insert in DB:
$clients = $serializer->deserialize($myJson, 'App\Entity\Client[]', 'json', [AbstractNormalizer::OBJECT_TO_POPULATE => $clientRepository->findAll()]);
Did I miss something ?
-- The official doc I found did not mention it: https://symfony.com/doc/current/components/serializer.html#deserializing-in-an-existing-object --
EDIT: I manage to do it manually with decode json into array, then loop on it, re-encode into json each item in loop and finally deserialize them. But if there is a way to do it without decode/loop/encode I prefer to use it !