Categories
How to deserialize an array?
How to deserialize an array:
[ {"name":"name1"}, {"name":"name2"} ]
$student = $this->serializer->deserialize( $response->getContent(), Student::class, 'json' );
Answer the question
In order to leave comments, you need to log in
https://symfony.com/doc/current/components/serial...
$student = $this->serializer->deserialize( $response->getContent(), Student::class.'[]', 'json' );
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question