Question

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
Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top