-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Serializer] Ignore \Traversable in default normalizers. #14540
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
Thank you @dunglas. |
…dunglas) This PR was merged into the 2.7 branch. Discussion ---------- [Serializer] Ignore \Traversable in default normalizers. | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #14495 | License | MIT | Doc PR | n/a Before the merge of #13500, default normalizers where never called for `\Traversable` objects. This PR restore the previous behavior in a cleaner way. This is also convenient when dealing with Doctrine's ArrayCollection and serialization groups (see #14495). ping @symfony/deciders Commits ------- c9bff46 [Serializer] Ignore \Traversable in default normalizers. Close #14495.
By the way, do not serialising As it'd be a really convenient feature, what do you think about adding an optional framework:
serializer:
normalizers:
traversable: true Well, that can be a way of doing for all normalizers by the way. |
The flag can be passed to the constructor of normalizers an the supports method can use it. |
I would prefer a dedicated normalizer that just delegates normalization of each item to other normalizers (though the chained one) instead of putting more conditions in existing normalizers. |
I agree. What about the reverse side of #14343 ? |
Yeah, it'd be nice. Maybe this PR should also supports deserialization of any I've some other ideas like the ability to define an accessor for given attributes, so... is the serializer features are frozen because of 2.7 beta or is it still open ? |
It's frozen for 2.7 but open for 2.8 and 3.0. |
To be more precise, it's frozen for 2.7, open for 2.8, closed for 3.0. All new features must happen in 2.8, not 3.0. |
Before the merge of #13500, default normalizers where never called for
\Traversable
objects. This PR restore the previous behavior in a cleaner way.This is also convenient when dealing with Doctrine's ArrayCollection and serialization groups (see #14495).
ping @symfony/deciders