dunglas/doctrine-json-odm

Symfony 3.3 : non-existent service "serializer.property_accessor"

vcastro45 opened this issue · 2 comments

On Symfony 3.3, initialisation failed with this error:

The service "dunglas_doctrine_json_odm.serializer" has a dependency on a non-existent service "serializer.property_accessor".

It seems on this version, property accessor service is not available through serializer.property_accessor, but property_accessor.

vagrant@ubuntu-xenial:~/projects/myProject/backend$ console debug:container PropertyAccessorInterface                  
                                                                                                                             
 Select one of the following services to display its information [Symfony\Component\PropertyAccess\PropertyAccessorInterface]
:                                                                                                                            
  [0] Symfony\Component\PropertyAccess\PropertyAccessorInterface                                                             
 > 0                                                                                                                         
                                                                                                                             
                                                                                                                             
 // This service is an alias for the service property_accessor                                                               
                                                                                                                             
Information for Service "property_accessor"                                                                                  
===========================================                                                                                  
                                                                                                                             
 ---------------- ---------------------------------------------------                                                        
  Option           Value                                                                                                     
 ---------------- ---------------------------------------------------                                                        
  Service ID       property_accessor                                                                                         
  Class            Symfony\Component\PropertyAccess\PropertyAccessor                                                         
  Tags             -                                                                                                         
  Public           no                                                                                                        
  Synthetic        no                                                                                                        
  Lazy             no                                                                                                        
  Shared           yes                                                                                                       
  Abstract         no                                                                                                        
  Autowired        no                                                                                                        
  Autoconfigured   no                                                                                                        
 ---------------- ---------------------------------------------------                                  

Workaround:

services:
    serializer.property_accessor: '@property_accessor'

Same issue occurs with serializer.encoder.json

I was missing this in configuration, sorry

framework:
    serializer:
        enabled: true