-
-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store #type
in top level objects only
#72
Comments
Should be doable, yes. Although we need to make sure it can still handle the nested ones for BC reasons. I don't feel like migrating all the old data 😄 |
It's not totally doable. One great feature of this tool is that you can store totally dynamic data (
This type of very dynamic graph cannot be handled without storing |
But for that type of very dynamic graph, you can write a custom normalizer, or implement I think we can have an option (not enabled by default) to choose if we want to store the |
Don't we usually know the top level type already? In most cases for me that looks either like that:
or like so:
So I think either we always store the |
I see three different strategies here:
|
PHP supports union types since 8.0 so storing a type is very useful in my opinion :) |
Closing, we don't intend to change the current behavior for the reasons exposed, and because of union types. |
Can we store the
#type
key in top level objects only?For any other object in the graph, we should leverage the standard symfony serializer ability to extract the the object class reading the phpdoc or type-hint.
The text was updated successfully, but these errors were encountered: