Category: endpoint

Json endpoint circular reference handler HTTP 500 ERROR

Im currently making an json endpoint for objects (tickets). This is my function: /** * @Route(“/json/tickets”, name=”json_tickets”) */ public function jsonTickets() { $encoders = [new XmlEncoder(), new JsonEncoder()]; $normalizers = [new ObjectNormalizer()]; $serializer = new Serializer($normalizers, $encoders); $tickets = $this->getDoctrine()->getRepository(Ticket::class)->findAll();…