Skip to content

[Serializer] Fix denormalizing scalar with UnwrappingDenormalizer #39180

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

camilledejoye
Copy link
Contributor

Q A
Branch? 5.1
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #38983
License MIT
Doc PR none

In order to work the UnwrappingDenormlizer needs to be called first to unwrap the data so that it can be handled by other denormalizers.
To not introduce any BC break this PR does not move the logic into it's own class, instead it checks if a denormalizer supports the data and only denormalize scalar values if there is none.

@camilledejoye camilledejoye force-pushed the bugfix-38983/scalar-denormalization-unwrapping branch from 8679530 to 21ce093 Compare November 26, 2020 13:58
@camilledejoye camilledejoye force-pushed the bugfix-38983/scalar-denormalization-unwrapping branch from 21ce093 to 98cf389 Compare November 26, 2020 18:43
@fabpot
Copy link
Member

fabpot commented Nov 27, 2020

Thank you @camilledejoye.

@fabpot fabpot merged commit 3d384ba into symfony:5.1 Nov 27, 2020
@camilledejoye camilledejoye deleted the bugfix-38983/scalar-denormalization-unwrapping branch November 27, 2020 08:43
This was referenced Nov 29, 2020
hultberg pushed a commit to hultberg/symfony that referenced this pull request Sep 17, 2021
…ngDenormalizer (camilledejoye)

This PR was merged into the 5.1 branch.

Discussion
----------

[Serializer] Fix denormalizing scalar with UnwrappingDenormalizer

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix symfony#38983
| License       | MIT
| Doc PR        | none

In order to work the `UnwrappingDenormlizer` needs to be called first to unwrap the data so that it can be handled by other denormalizers.
To not introduce any BC break this PR does not move the logic into it's own class, instead it checks if a denormalizer supports the data and only denormalize scalar values if there is none.

Commits
-------

98cf389 fix denormalizing scalar with UnwrappingDenormalizer
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