Skip to content

[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

Merged
merged 1 commit into from
Sep 8, 2021

Conversation

vuryss
Copy link
Contributor

@vuryss vuryss commented Jun 8, 2021

Q A
Branch? 5.4
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix #40578
License MIT

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.

@vuryss vuryss requested a review from dunglas as a code owner June 8, 2021 11:31
@vuryss vuryss force-pushed the serializer_skip_uninitialized_40578 branch from 5c235b2 to d129544 Compare June 8, 2021 11:58
@nicolas-grekas nicolas-grekas added this to the 5.4 milestone Jun 8, 2021
@vuryss vuryss force-pushed the serializer_skip_uninitialized_40578 branch from d129544 to 9cb2dc3 Compare June 8, 2021 12:42
@carsonbot
Copy link

Hey!

I think @mkrauser has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

@vuryss vuryss force-pushed the serializer_skip_uninitialized_40578 branch 2 times, most recently from a73c938 to c0fb162 Compare June 9, 2021 09:09
Copy link
Member

@nicolas-grekas nicolas-grekas left a 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?

@vuryss vuryss force-pushed the serializer_skip_uninitialized_40578 branch 2 times, most recently from 6b733b4 to 9cc7bd2 Compare September 8, 2021 10:54
@vuryss
Copy link
Contributor Author

vuryss commented Sep 8, 2021

Can you please rebase to trigger the CI again while fixing the review?

Done. Thanks for the help with low deps issue. The failing test now does not seem to have anything in common with my changes.

@vuryss vuryss force-pushed the serializer_skip_uninitialized_40578 branch from 9cc7bd2 to 1b9ee7e Compare September 8, 2021 12:51
@derrabus
Copy link
Member

derrabus commented Sep 8, 2021

Thank you @vuryss.

@derrabus derrabus merged commit a8cc21e into symfony:5.4 Sep 8, 2021
@vuryss vuryss deleted the serializer_skip_uninitialized_40578 branch September 8, 2021 13:46
This was referenced Nov 5, 2021
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Oct 26, 2022
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants