Can't control customized entity properties in serialization


#1

update: solved
i added some new properties to product
now i want to control what properties should be serialized.
eg: i added two properties
anotherOneFree
assignedFreeProduct
i want anotherOneFree to be exposed and assignedFreeProduct not.
i created serialization file in AppBundle/Resources/config/serializer/Model.Product.yml

AppBundle\Entity\Product:
    exclusion_policy: ALL
    xml_root_name: product
    properties:
        anotherOneFree:
            expose: true
            type: string
        assignedFreeProduct:
            expose: false
            type: float

and in my config file

jms_serializer:
    metadata:
        directories:
            custom-sylius:
                namespace_prefix: "AppBundle\\Entity"
                path: "@AppBundle/Resources/config/serializer"

but nothing happens
and both properties are serialized


#2

ok i found what i was missing the serialization file name was wrong
it should be
AppBundle/Resources/config/serializer/Entity.Product.yml
not
AppBundle/Resources/config/serializer/Model.Product.yml