2
votes

I'm trying to use JMSSerializerBundle, I installed it with Composer.

I generated my OwnBundle with the symfony generator, and I'm able to use $this->get('serializer')

However, I'd like to override configuration as it is stated in the documentation, so I created a config.yml in My/OwnBundle/Resources/config/ and I put

  jms_serializer:
    metadata:
      directories:
        OwnBundle:
          namespace_prefix: My\OwnBundle
          path: %kernel.root_dir%/serializer/

To make sure my config is loaded, I added

$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
$loader->load('config.yml');

But I got this error when running console tool:

There is no extension able to load the configuration for "jms_serializer" (in ~/My/OwnBundle/DependencyInjection/../Resources/config/config.yml). Looked for namespace "jms_serializer", found none

Am I doing something wrong?

For informations, my services.yml is empty (empty services & parameters).

I'm totally new to Symfony2, but I RTFM.

1

1 Answers

0
votes

Did you forget to register the JMSSerializer namespace in autoload.php? Check that file to see if it is there.