Reading the doc does help: The key for the entity in the yaml file must be the fully qualified class name, hence:
My\FooBundle\Entity\Asset:
exclusion_policy: ALL
works as expected.
题
I am trying to configure JMS/Serializer to exclude properties of my entities.
Yet I am stuck at following exception:
Expected metadata for class My\FooBundle\Entity\Asset to be defined in ~/src/test/src/My/FooBundle/Resources/config/serializer/Entity.Asset.yml.
What is the expected metadata I need to define there?
My Entity.serializer.yml
consists only of
Asset:
exclusion_policy: ALL
解决方案
Reading the doc does help: The key for the entity in the yaml file must be the fully qualified class name, hence:
My\FooBundle\Entity\Asset:
exclusion_policy: ALL
works as expected.