You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I understand correctly, this should have been fixed from version 3.3.0 (by looking at the merge commit). However, I am using 3.9.0 with the symfony bundle version 3.7.0 and unfortunately I am still running into this issue (with the same POC as in the original issue).
(This issue might be a problem in https://github.com/schmittjoh/metadata)
Steps required to reproduce the problem
Declare a class as follow
What is important here is:
property
(to conflict with getter)VirtualProperty
annotation (to tell serializer we do need this property in serialized result)Expected Result
{property: 42}
Actual Result
{}
Ideas to solve the issue
I did dig a bit into the code, to me the issue lie in https://github.com/schmittjoh/metadata.
In fact
ClassMetadata->propertyMetadata
here do have only one property indexed with keyproperty
and this property do not have getter.So my guess is that the getter get override by the property which lead to no data instead of the one provided by
getProperty()
.Looking at current master the bug might still lie here https://github.com/schmittjoh/metadata/blob/092b94df35862670a1c0411b66a872070ed2b53d/src/ClassMetadata.php#L53-L56
Workaround
The current workAround is to have a wrapper around
getProperty()
with a different name:P.S.: I did not check if this happen on 2.x / 3.x
The text was updated successfully, but these errors were encountered: