JMSSerializerBundle icon indicating copy to clipboard operation
JMSSerializerBundle copied to clipboard

@Serializer\Exclude() broken since 3.5

Open thedomeffm opened this issue 4 years ago • 6 comments

With version "jms/serializer-bundle": "^3.5",

the short form of @Exclude (in annotations?) does not work fine:

    /**
     * @var Client
     *
     * @Serializer\Exclude()
     *
     * @ORM\ManyToOne(targetEntity="Client")
     * @ORM\JoinColumn(name="client_id", referencedColumnName="id")
     */

But this works:

    /**
     * @var Client
     *
     * @Serializer\Exclude(if="true")
     [...]

thedomeffm avatar Apr 30 '20 16:04 thedomeffm

Info: In normal properties like $createdAt it is working fine. It has something to do with the reference.

thedomeffm avatar May 01 '20 10:05 thedomeffm

can you please tell which version of jms/serializer and jms/metadata are you using?

goetas avatar May 01 '20 19:05 goetas

this is weird to me as the version that supports @Exclude(if="something") has not yet been released

goetas avatar May 04 '20 17:05 goetas

composer.json

"jms/serializer-bundle": "^3.5",

composer.lock

[...]
{
    "name": "jms/metadata",
    "version": "2.1.0",
},
{
    "name": "jms/serializer",
    "version": "3.6.0",
},
{
    "name": "jms/serializer-bundle",
     "version": "3.5.0",
}
[...]

thedomeffm avatar May 07 '20 14:05 thedomeffm

I've tried to reproduce this without success, can you try to submit a failing test case?

goetas avatar May 08 '20 06:05 goetas

I have another test case here: https://github.com/schmittjoh/JMSSerializerBundle/issues/889 Maybe it's the same issue.

praditha-hidayat avatar Apr 11 '22 02:04 praditha-hidayat