-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Labels
Description
Given I have dummies
which is an array of Dummy
entity, the following works fine:
$serializer = $this->get('serializer');
$serializedContent = serializer->serialize($dummies, 'json');
And $serializedContent
is something like:
"[
{
// properties of dummy object
},
...
{
// properties of dummy object
}
]"
However the reverse won't work because the deserialize
method won't take the input as an array of Dummy
objects.
It's really a pain and often requires to decode the JSON beforehand and then loop on the returned array to construct our list of entities. If this feature was supported, simply extracting the string array of the json would be enough.
Moreover it seems a bit weird not to have this feature since it's available for the serialization.
ping @dunglas.