This repository was created with those commands:
composer create-project symfony/skeleton my_project_name
composer require jms/serializer-bundle:3.5
; then two services were added:
App\Services\SerializationContextFactory
App\Services\TestService
; and the JMSSerializerBundle config was altered like this:
jms_serializer:
[ ... ]
default_context:
serialization:
id: App\Services\SerializationContextFactory
To trigger the error run bin/console c:c