Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[Serializer] documentation for allow_extra_attributes#6975
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
f4400f3 toe6818fcComparecomponents/serializer.rst Outdated
| has a fourth parameter, the context. If you want to throw an exception if an attribute is outside | ||
| the object scope, use ``allow_extra_attributes`` as ``false``. | ||
| This will throws a:class:`Symfony\\Component\\Serializer\\Exception\\ExtraAttributesException` exception, |
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.
This will throw an [...]
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.
done
components/serializer.rst Outdated
| the object scope, use ``allow_extra_attributes`` as ``false``. | ||
| This will throws a:class:`Symfony\\Component\\Serializer\\Exception\\ExtraAttributesException` exception, | ||
| because city is not an attribute of ``Acme\Person``:: |
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.
[...] because city is not an attribute of thePerson class
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.
done
components/serializer.rst Outdated
| by the serializer. | ||
| :method:`Symfony\\Component\\Serializer\\Serializer::deserialize` | ||
| has a fourth parameter, the context. If you want to throw an exception if an attribute is outside | ||
| the object scope, use ``allow_extra_attributes`` as ``false``. |
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.
I would reword this a bit:
By default, additional attributes that are not mapped to the denormalized object will be ignored by the Serializer component. Set the
allow_extra_attributeskey of the deserialization context tofalseto let the serializer throw an exception when additional attributes are passed.
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.
done
e6818fc to8318e14Compare8318e14 to28dcc94Comparejuliendidier commentedSep 22, 2016
@xabbuh thanks for your review |
… used during an object denor… (juliendidier)This PR was merged into the 3.3-dev branch.Discussion----------[Serializer] Throw exception when extra attributes are used during an object denor…| Q | A || --- | --- || Branch? | "master" || Bug fix? | no || New feature? | yes || BC breaks? | no || Deprecations? | no || Tests pass? | yes || Fixed tickets | #19948 || License | MIT || Doc PR | [#6975](symfony/symfony-docs#6975) |I will update the doc if you're ok with this PR.Commits-------565a984 throw exception when extra attributes are used during an object denormalization
… used during an object denor… (juliendidier)This PR was merged into the 3.3-dev branch.Discussion----------[Serializer] Throw exception when extra attributes are used during an object denor…| Q | A || --- | --- || Branch? | "master" || Bug fix? | no || New feature? | yes || BC breaks? | no || Deprecations? | no || Tests pass? | yes || Fixed tickets |#19948 || License | MIT || Doc PR | [#6975](symfony/symfony-docs#6975) |I will update the doc if you're ok with this PR.Commits-------565a984 throw exception when extra attributes are used during an object denormalization
xabbuh commentedDec 6, 2016
The code PR has been merged. |
wouterj commentedDec 17, 2016
👍 (there is a minor issue with the line length and the second paragraph can maybe replaced by a code comment in de code itself, but those things can be fixed during the merge) |
xabbuh commentedMar 3, 2017
Thank you@juliendidier. |
…juliendidier)This PR was merged into the master branch.Discussion----------[Serializer] documentation for allow_extra_attributesDoc PR for [symfony/symfony#19958](symfony/symfony#19958)Commits-------28dcc94 [Serializer] documentation for allow_extra_attributes
Doc PR forsymfony/symfony#19958