Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Serializer] UnwrappingDenormalizer#31390
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
4c2eb4b
to5b757a9
Comparesrc/Symfony/Component/Serializer/Normalizer/UnwrappingDenormalizer.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Serializer/Normalizer/UnwrappingDenormalizer.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Serializer/Normalizer/UnwrappingDenormalizer.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Serializer/Normalizer/UnwrappingDenormalizer.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Serializer/Normalizer/UnwrappingDenormalizer.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Serializer/Normalizer/UnwrappingDenormalizer.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Serializer/Normalizer/UnwrappingDenormalizer.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
fe55720
to1e97075
Compare1e97075
to079b781
CompareThere 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.
Please also add unit tests for the denormalizer itself.
src/Symfony/Bundle/FrameworkBundle/Resources/config/serializer.xml OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
733d445
tof456490
Compare00aeeff
to5b9c3d8
Compareinject an existing instance of PropertyAccess, implement hasCacheableSupportsMethodCoding Standard fixresolve conversationstest denormalizer
f536749
to00d103d
Compare
Hi. Can you please take a look? Waiting for your approval |
Thank you@nonanerz. |
This PR was merged into the 5.1 branch.Discussion----------[FrameworkBundle] Extension Serializer issue| Q | A| ------------- | ---| Branch? | 5.1| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets | ???| License | MIT| Doc PR |Hi,When creating a new Symfony project and requiring `symfony/serializer` we have an issue with required service.Here is a simple reproducer:This bug was introduced by#31390Commits-------ab5628f FrameworkBundle Serializer issue
This PR was merged into the 5.1-dev branch.Discussion----------[Serializer] UnwrappingDenormalizer| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | n/a| License | MIT| Doc PR | n/aUnwrappingDenormalizer, registered with very high priority. Unwrapping the data if UNWRAP_PATH is provided.Very often some APIs give nested responses in which we need only the child object. With UnwrappingDenormalizer we can get the needed object without creating unnecessary Model class that we don't really need.Regarding tosymfony#28887 andsymfony#30894Usage:`$serialiser->deserialize('{"baz": {"foo": "bar", "inner": {"title": "value", "numbers": [5,3]}}}', Object::class, ['UnwrappingDenormalizer::UNWRAP_PATH' => '[baz][inner]'])`Commits-------00d103d UnwrappingDenormalizer
Uh oh!
There was an error while loading.Please reload this page.
UnwrappingDenormalizer, registered with very high priority. Unwrapping the data if UNWRAP_PATH is provided.
Very often some APIs give nested responses in which we need only the child object. With UnwrappingDenormalizer we can get the needed object without creating unnecessary Model class that we don't really need.
Regarding to#28887 and#30894
Usage:
$serialiser->deserialize('{"baz": {"foo": "bar", "inner": {"title": "value", "numbers": [5,3]}}}', Object::class, ['UnwrappingDenormalizer::UNWRAP_PATH' => '[baz][inner]'])