class Item
{
public $id;
//..getters and setters
}
$data = [['id' => 1], ['id' => 2]];
$serializer = new Serializer([new GetSetMethodNormalizer(), new ArrayDenormalizer()]);
$model = $serializer->denormalize($data, "Item[]");
dump($model);die;
And I'm getting error:
Could not denormalize object of type Item[], no supporting normalizer found.
All like in this example - https://symfony.com/doc/current/components/serializer.html#handling-arrays Why I'm getting error?