Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install JMSSerializerBundle

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.  
like image 907
Sadiel Avatar asked Apr 25 '26 12:04

Sadiel


2 Answers

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.

like image 156
Wouter J Avatar answered Apr 28 '26 05:04

Wouter J


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),
like image 29
Sadiel Avatar answered Apr 28 '26 04:04

Sadiel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!