Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Serializer] Fix extra attributes when no group specified#24816
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[Serializer] Fix extra attributes when no group specified#24816
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| $allowedAttributes =$this->getAllowedAttributes($class,$context,true); | ||
| if (false ===$allowedAttributes &&$this->classMetadataFactory) { |
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.
It's probably useless to do this if$context[self::ALLOW_EXTRA_ATTRIBUTES] is not set.
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.
Right. Thanks :)
fabpot commentedNov 5, 2017
Thank you@ogizanagi. |
…(ogizanagi)This PR was merged into the 3.3 branch.Discussion----------[Serializer] Fix extra attributes when no group specified| Q | A| ------------- | ---| Branch? | 3.3 <!-- see comment below -->| Bug fix? | yes| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->| BC breaks? | no| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->| Tests pass? | yes| Fixed tickets |#24783 <!-- #-prefixed issue number(s), if any -->| License | MIT| Doc PR | N/A~~Two commits, for two possible solutions, but I think the last one is probably the most efficient one, as the first one will also impact normalization and systematically try to intersect allowedAttributes and extractedAttributes.~~Commits-------d1b343c [Serializer] Fix extra attributes when no group specified
This PR was merged into the 3.4 branch.Discussion----------[Serializer] Remove const override| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | no| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->| BC breaks? | no <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- don't forget to update UPGRADE-*.md files -->| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets | N/A <!-- #-prefixed issue number(s), if any -->| License | MIT| Doc PR | N/AThis public const was moved to parent class in#24816Commits-------25312c4 [Serializer] Remove const override
…mented (deviantintegral)This PR was squashed before being merged into the 3.4 branch (closes#26534).Discussion----------allow_extra_attributes does not throw an exception as documented| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | yes| New feature? | no| BC breaks? | no <!-- seehttps://symfony.com/bc -->| Deprecations? | no| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets | none| License | MIT| Doc PR | noneThe example at [Deserializing an object](https://symfony.com/doc/current/components/serializer.html#deserializing-an-object) does not actually work. It looks like this is a bug and not a docs issue.#24783 reported the same bug, but it looks like the fix at#24816 isn't complete.Here's a failing test that copies the existing example.Commits-------a67b650 allow_extra_attributes does not throw an exception as documented
Uh oh!
There was an error while loading.Please reload this page.
Two commits, for two possible solutions, but I think the last one is probably the most efficient one, as the first one will also impact normalization and systematically try to intersect allowedAttributes and extractedAttributes.