-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Serializer] Add option to skip uninitialized typed properties #41615
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
[Serializer] Add option to skip uninitialized typed properties #41615
Conversation
5c235b2
to
d129544
Compare
d129544
to
9cb2dc3
Compare
Hey! I think @mkrauser has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
a73c938
to
c0fb162
Compare
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.
Can you please rebase to trigger the CI again while fixing the review?
src/Symfony/Component/Serializer/Tests/Normalizer/Features/SkipUninitializedValuesTestTrait.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Serializer/Tests/Normalizer/Features/TypedPropertiesObject.php
Outdated
Show resolved
Hide resolved
6b733b4
to
9cc7bd2
Compare
Done. Thanks for the help with low deps issue. The failing test now does not seem to have anything in common with my changes. |
src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php
Outdated
Show resolved
Hide resolved
9cc7bd2
to
1b9ee7e
Compare
Thank you @vuryss. |
…ES option (vuryss, ivannemets-sravniru) This PR was merged into the 5.4 branch. Discussion ---------- [Serializer] Documenting the new SKIP_UNINITIALIZED_VALUES option Documents changes introduced here: symfony/symfony#41615 Original issue: symfony/symfony#40578 Docs issue: #15785 Commits ------- 08599e8 Update serializer.rst 034f0f6 [Serializer] Documenting the new SKIP_UNINITIALIZED_VALUES option
Adds the ability to skip uninitialized values from Serializer. This is useful when using typed properties in 7.4 and those without default values should not be included in the result.
This works correctly when we're not using serializer groups, but when using the groups - it breaks badly, so it's also kind of a fix in addition to feature.