Answer the question
In order to leave comments, you need to log in
FOSRestBundle how to make it work with symfony/serializer?
serializationGroups not working.
Controller:
/**
* @Route("/", name="homepage")
* @FOS\View(serializerGroups={"registration"})
*/
public function indexAction()
{
return $this->get('app.user_repository')->findAll();
}
Attempted to load class \"SerializationContext\" from namespace \"JMS\\Serializer\".\nDid you forget a \"use\" statement for another namespace?
Answer the question
In order to leave comments, you need to log in
https://github.com/FriendsOfSymfony/FOSRestBundle/...
TL;DR
symfony/serializer started supporting serialization groups only from version 2.7, before that only jms serializer could do this. Therefore, fosrest simply does not yet know how to use symfony / serializer for these purposes. Alas, adding full support for symfony/serializer will lead to rather sad BC-breaks and we will only see its full support in FOSRestBundle 2.0.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question