I would like to visit recursively each property of the serializing Entity, check if a string is set and verify that the metadata property is properly set to string
, otherwise change it in order to allow the serialization.
Imagine a users
property which is an ArrayCollection
, but I force the value to be a string in corner cases.
I set a SerializationSubscriber
to catch the serializer.pre_serialize
event, but I'm not finding any doc for take advantage of the Visitor
and surroundings.
Any hint?