Fixed the serializer initialization for 2.0

Refs symfony/symfony#7145