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
I use a custom visitor class (declared using Symfony DIC).
In the "getResult" method, DateTime objects are converted to ArrayObject, instead of string (I can see that in standard JsonSerializationVisitor, DateTime objects are well converted, when printing "$this->getRoot()" in getResults()), that leads to empty string in my final output.
Steps required to reproduce the problem
Configure a custom visitor class (I'm using JMS serializer with Symfony)
launch serialization with data containing some DateTime objects
In the "getResult" method, print the content of this->getRoot()
Expected Result
DateTime are converted to string at this level (this is what I see if I use standard serializer)
Actual Result
DateTime object are converted to ArrayObject at this level
Even if I declare the standard JsonSerializationVisitor class as custom class serializer, the problem occurs: it seems to be related to the use of a custom serilizer class, not to the class itself
I use a custom visitor class (declared using Symfony DIC).
In the "getResult" method, DateTime objects are converted to ArrayObject, instead of string (I can see that in standard
JsonSerializationVisitor
, DateTime objects are well converted, when printing "$this->getRoot()" in getResults()), that leads to empty string in my final output.Steps required to reproduce the problem
Expected Result
Actual Result
JsonSerializationVisitor
class as custom class serializer, the problem occurs: it seems to be related to the use of a custom serilizer class, not to the class itselfCode Extracts
Configuration of custom serializer
Serialized data
Output with "custom" format
Trace in JsonSerializationVisitor:
Output
Output using regular "custom" format
The text was updated successfully, but these errors were encountered: