I'm getting this error, and tried every solution, but, still couldn't figure it out. someone got the same error as me ?
A circular reference has been detected when serializing the object of class "AppBundle\Entity\Loisir" (configured limit: 1)
My code
public function allAction()
{
$Loisirs =$this->getDoctrine()->getManager()
->getRepository('AppBundle:Loisir')->findALL();
$serializer =new Serializer([new ObjectNormalizer()]);
$formatted =$serializer->normalize($Loisirs);
return new JsonResponse($formatted);
}