FriendsOfSymfony / FOSRestBundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

Home Page:http://symfony.com/doc/master/bundles/FOSRestBundle/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Decoration of JMS handler registry

goetas opened this issue · comments

Hi all!

I'm working on a feature to add to the jms/serializer-bundle a profiler feature (schmittjoh/JMSSerializerBundle#858). FOSRestBundle does some "weird" decoration of the jms handler registry in https://github.com/FriendsOfSymfony/FOSRestBundle/blob/3.x/DependencyInjection/Compiler/HandlerRegistryDecorationPass.php ... the decoration mechanism in place breaks the symfony decoration and does not allow to decorate the handler registry at all...

Is there a reason to not use the symfony built-in decoration mechanism instead of doing it manually?

I know that there are discussions to remove the handler registry (can not find the thread anymore....)

If I create a PR that replaces the current decoration mechanism with the symfony one... would it be accepted? Is there anything in particular i should know?

I don't remember why we did it that way. Can you try to replace our custom solution with proper service decoration and see if all tests still pass? That could give us a clue hopefully.

@xabbuh If I understand correctly, your decorator tries to find serialization config from parent classes if it was not found in concrete class

I've started #2319