this goes into the direction of what I wanted to achieve in https://github.com/FriendsOfSymfony/FOSRestBundle/pull/561/files#diff-3b898a9b28925d8dc60210cb06ed7719R14