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
Doing this manually, i.e. mapping stdClass to MyDTO is pretty simple. But I'm looking for a more generic solution.
But I don't understand why I have to add annotations to my DTO to force types. I have validation on a separate level, here I just want a DTO, i.e. a stdClass but with a known schema (good for autocompletion for example).
So am I missing something, is this something possible with this library? Or is there a reason it's not?
The text was updated successfully, but these errors were encountered:
We might be able to infer primitive types for JSON, for XML or object types I don't see how this could work. Therefore, when you deserialize data, type information must be added through metadata (f.e. @Type) at the moment.
Hi there, first time user of this lib so maybe I'm not getting it correctly.
I'm using this lib to serialize/unserialize DTO objects to JSON (or whatever).
So instead of using
json_decode
and ending up with astdClass
, I'd like to use:And
$dto
would be an instance of:Doing this manually, i.e. mapping
stdClass
toMyDTO
is pretty simple. But I'm looking for a more generic solution.But I don't understand why I have to add annotations to my DTO to force types. I have validation on a separate level, here I just want a DTO, i.e. a
stdClass
but with a known schema (good for autocompletion for example).So am I missing something, is this something possible with this library? Or is there a reason it's not?
The text was updated successfully, but these errors were encountered: