You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The use case for this is likely the same as other denormalization use cases: sometimes you want to pre-fill fields that are not updated by the serializer. Especially if your custom denormalization process depends on those pre-filled fields.
The text was updated successfully, but these errors were encountered:
…ustomNormalizer (chrisguitarguy)
This PR was squashed before being merged into the 3.4 branch (closes#21716).
Discussion
----------
[Serializer] Add Support for `object_to_populate` in CustomNormalizer
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #21715
| License | MIT
| Doc PR | n/a
This pulls a trait out of `AbstractNormalizer` with a method to extract the object to populate and adds some tests for it. Then uses that trait in both `AbstractNormalizer` and `CustomNormalizer` so both can support the `object_to_populate` key.
Commits
-------
ec9242d [Serializer] Add Support for in CustomNormalizer
Uh oh!
There was an error while loading. Please reload this page.
The
CustomNormalizer
simply doesnew $class();
to create the object to denormalize. Would be useful to be able to populate an existing object.The use case for this is likely the same as other denormalization use cases: sometimes you want to pre-fill fields that are not updated by the serializer. Especially if your custom denormalization process depends on those pre-filled fields.
The text was updated successfully, but these errors were encountered: