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
Variable \"object\" is not valid around position 3 for expression `!(object.isRedacted() === false)`.
Expected Result
I expect a successful deserialization.
Actual Result
Serialization failed with above exception message. As I looked closer at the code it seems that the object variable is only set when there is a SerializationContext. Meaning ofcourse that this variable is not available during deserialization. You can find this in class JMS\Serializer\Exclusion\ExpressionLanguageExclusionStrategy line 60.
Although this might be quite logical since the object is still being created (and I actually don't need this expression to be evaluated during deserialization), however how do I only enable it on serialization? Or actually what would be the best way to do this? I can ofcourse extend the expression but since I have this expression on like 106 properties I would like to keep these expressions as simple and clean as possible. Or maybe I should write a custom exclusion strategy...
The text was updated successfully, but these errors were encountered:
Yes I indeed already tried the workaround (forgot to mention) but the full expresion is always evaluated. Your commit seems promising though I will have a look at it.
I was also thinking if it might be possible to catch the exception and just return false if the variable does not exist. But that might give other problems as the exception returned seems to be a generic, Symfony\Component\ExpressionLanguage\SyntaxError.
Steps required to reproduce the problem
Expected Result
Actual Result
Although this might be quite logical since the object is still being created (and I actually don't need this expression to be evaluated during deserialization), however how do I only enable it on serialization? Or actually what would be the best way to do this? I can ofcourse extend the expression but since I have this expression on like 106 properties I would like to keep these expressions as simple and clean as possible. Or maybe I should write a custom exclusion strategy...
The text was updated successfully, but these errors were encountered: