-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Closed
Description
Q | A |
---|---|
Bug report? | yes |
Feature request? | no |
BC Break report? | no |
RFC? | no |
Symfony version | 3.2.4 |
CsvEncoder class seems to not consider context.
This leads to "circular reference" error on encoding since Groups Annotaton are not processed.
Example:
$serializer = new Serializer([new ObjectNormalizer()], [new CsvEncoder()]);
$data = $serializer->encode($items, 'csv', array('groups' => array('export')));
The entitiy has only one field with the annotation "groups":
/**
* @var string
*
* @ORM\Column(name="title", type="string", length=255)
* @Groups({"export"})
* @Assert\NotNull()
*/
private $title;
As far as I can see, the CsvEncoder
Class Symfony\Component\Serializer\Encoder\CsvEncoder
does not consider the $context
at all.
Even though the method public function encode($data, $format, array $context = array())
defines it, $context
is nowhere used in the method.