Question

I installed FOSRestBundle but it needs JMSSerializerBundle.

I added in my deps the next lines:

[JMSSerializerBundle]
    git=git://github.com/schmittjoh/JMSSerializerBundle.git
    target=bundles/JMS/SerializerBundle

Here it explains how to do it: http://jmsyst.com/bundles/JMSSerializerBundle/master/installation

but when I try $php bin/vendors install it shows me an error:

[InvalidArgumentException]                                          
  The service definition "jms_serializer.serializer" does not exist.  
Was it helpful?

Solution 2

The manual says it to register the bundle with the kernel:

new JMS\Serializer\JMSSerializerBundle($this),

but the installer create the folder: vendor/bundles/JMS/SerializerBundle

so, it must be added the next line to the AppKernel.php instead of the other:

new JMS\SerializerBundle\JMSSerializerBundle($this),

OTHER TIPS

You should comment the new FOS\RestBundle\FOSRestBundle(), line in AppKernel.php in the registerBundles() method. Then install the JmsSerializerBundle and after that you should decommend that line and register the JsmSerializerBundle.

Did you also do the following steps from the manual? Sounds to me like you didn't add the line

new JMS\Serializer\JMSSerializerBundle($this)

to AppKernel.php

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top