Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Serializer] Custom normalizer update #18603

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

Conversation

alexandre-daubois
Copy link
Member

Last PR to resolve #18507

@javiereguiluz
Copy link
Member

Yes! Alex, thanks a lot for taking care of the last pending change of #18507 👏

javiereguiluz added a commit that referenced this pull request Jul 24, 2023
This PR was merged into the 7.0 branch.

Discussion
----------

[Serializer] Custom normalizer update

Last PR to resolve #18507

Commits
-------

0fd8f8f [Serializer] Custom normalizer update
@jennevdmeer
Copy link
Contributor

jennevdmeer commented Aug 24, 2023

Bit late to the party but am I missing something (have not tried 7.0) but this example would not work? Looking at the serializer class in 7.0 it seems nothing has changed about its behavior.
https://github.com/symfony/symfony/blob/8105a092b16a10d704f0e64b1194f0d0ea0234b3/src/Symfony/Component/Serializer/Serializer.php#L92-L94

You mention it yourself in #18779. But then using NormalizerAwareInterface/NormalizerAwareTrait would still set the Serializer class instance for the normalizer property resulting in the custom normalizer supporting $data recursively being called when you manually call $this->normalizer->normalize($data) in the normalize function.

I could not find anything about a PR that changes this to work well in 7.0 so should this be in here? At the least it should be a valid example with a "workaround" not?

Related things

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