Replies: 1 comment 10 replies
-
Hi @momala454, thanks for posting here. A property typed as a The I may add attribute support for local alteration of a source value, but works on this task have not yet begun. |
Beta Was this translation helpful? Give feedback.
10 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a json that have a property that is (kind of) randomly an object instead of a string.
How can I detect when the property is an object and convert it to a string ?
The object doesn't have a specific structure.
When I define the phpdoc of the property to
string|object
, it gives the errorAnd if I write it as
string
, obviously it will just says that it cannot be mapped ( CuyZ\Valinor\Mapper\TypeTreeMapperError)Apparently, transformers are only used for serializer, and not for mapper, so I can't use it.
I found the
alter
method, but it will be called for every attribute, not just the one I want to modify.Do you have any way to do that ?
Beta Was this translation helpful? Give feedback.
All reactions