Answer the question
In order to leave comments, you need to log in
Why doesn't the FOSRestBundle annotation work?
There is a route that must give anything. For example
/**
* Lists all Users
* @Rest\Get("/users")
* @Rest\View(serializerEnableMaxDepthChecks=true)
* @param EntityManagerInterface $em
* @return Response
*/
public function getUsers(EntityManagerInterface $em, SerializerInterface $serializer)
{
$users = $em->getRepository(User::class)->findAll();
// $users = $serializer->serialize($users, 'json', SerializationContext::create()->enableMaxDepthChecks());
$view = $this->view($users)->setData($users);
return $this->handleView($view);
}
ContextStack visiting not working well
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question