Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Serializer] Allow (de)normalization of empty objects in PropertyNormalizer#46417
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:7.4
Are you sure you want to change the base?
[Serializer] Allow (de)normalization of empty objects in PropertyNormalizer#46417
Conversation
carsonbot commentedMay 21, 2022
Hey! I think@mtarld has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
4989076
tob80705a
Compare@mtarld The original issue is marked as Also, I don't see any documentation for normalizers except forhttps://symfony.com/doc/5.2/serializer/normalizers.html#built-in-normalizers, I guess it's self-documented enough. And lastly, I'm still wondering if the backward compatible behavior is needed in this edge case. Or at least what about adding a deprecation notice in case the original check does not pass so that we can delete it in a subsequent version? I mean I don't mind and most people configuring their normalizers can probably find this configuration option but it would prevent the unexpected first encounter of this |
Yes indeed, IMO it must be a feature 🙂 I guess the documentation, code, and context builders are enough. For the BC migration path part, it is tricky. The behavior of these normalizers is changed (and the same goes for the serializer itself), so we must trigger a deprecation IMHO. Maybe we could leverage the WDYT? |
b80705a
to14f5c30
Compareolsavmic commentedMay 23, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Sounds good, I've added the deprecation, updated the default symfony bundle configuration (src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.php) and updated tests so that the deprecation is not triggered :) Do we want to target 6.1 or 6.2 release? |
38a3438
toca505aa
CompareAs 6.1 is in feature freeze, we must target 6.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Almost good for me! 🙂
src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
2d0f77f
tod7114f0
Compare72c0c98
to02a8212
CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM!
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
…alizer and GetSetMethodNormalizer
Update changelog
648b0d4
to9de526d
CompareFailing checks seem to be unrelated |
Anything I can do to get a second review and merge it? |
Uh oh!
There was an error while loading.Please reload this page.
This PR adds optional support for the normalization of objects without properties (in the case of
PropertyNormalizer
) or objects without getters (in the case ofGetSetMethodNormalizer
). Backward compatibility is preserved since this change is disabled by default for now.Reasoning behind this change is explained in the discussion of the linked issue (#46280)