Skip to content

[Serializer] Add ability to skip uninitialized properties #38972

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

Closed

Conversation

idsulik
Copy link

@idsulik idsulik commented Nov 3, 2020

Q A
Branch? 5.x
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix #...
License MIT
Doc PR symfony/symfony-docs#...

Add SKIP_UNINITIALIZED_PROPERTIES context property to AbstractObjectNormalizer to skip uninitialized properties when normalizing object.
PHP 7.4 thrown exception when you try go get uninitialized property, the PR add ability to skip those properties when normilizing

p.s. I don't know how to test because of project php version 7.2

…stractObjectNormalizer to skip uninitialized properties when normalizing object.
@idsulik idsulik requested a review from dunglas as a code owner November 3, 2020 12:17
@idsulik idsulik changed the title [Serializer] Add SKIP_UNINITIALIZED_PROPERTIES context property to Ab… [Serializer] Add ability to skip uninitialized properties Nov 3, 2020
@xabbuh xabbuh added this to the 5.x milestone Nov 3, 2020
@BoShurik
Copy link
Contributor

BoShurik commented Nov 3, 2020

Similar PR #38900 but as a bug fix

@idsulik
Copy link
Author

idsulik commented Nov 3, 2020

@BoShurik , #38900 - it fixes only property access, but not method access. for example - I have an private uninitialized property and getter for the property

@BoShurik
Copy link
Contributor

BoShurik commented Nov 3, 2020

Property access was fixed in #34791. #38900 fixes exactly what you describe

@idsulik
Copy link
Author

idsulik commented Nov 3, 2020

@BoShurik I'm sorry, you're right , it fixed #38900 but not merged. When it will be merged?

@BoShurik
Copy link
Contributor

BoShurik commented Nov 3, 2020

@idsulik I don't know. Waiting for review

@idsulik
Copy link
Author

idsulik commented Nov 3, 2020

@BoShurik okay, thank you! I think we can close the PR

@idsulik idsulik closed this Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants