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
bug #30950 [Serializer] Also validate callbacks when given in the normalizer context (dbu)
This PR was merged into the 4.2 branch.
Discussion
----------
[Serializer] Also validate callbacks when given in the normalizer context
| Q | A
| ------------- | ---
| Branch? | 4.2 (callbacks are handled differently in 3.4)
| Bug fix? | yes
| New feature? | no
| BC breaks? | no (unless somebody relied on this bug ignoring `null` as callback
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | Related to #30888
| License | MIT
| Doc PR | -
callbacks configuration for the normalizer is validated to be valid callbacks when using setCallbacks or using the callbacks field in the default options. however, it was not validated when using the callbacks field in a context passed to `normalize()`
Commits
-------
3789152 [serializer] validate that the specified callbacks and max_depth_handler are actually callable
thrownewInvalidArgumentException(sprintf('The given callback for attribute "%s" is not callable.', $attribute));
109
+
thrownewInvalidArgumentException(sprintf('Invalid callback found for attribute "%s" in the "%s" default context option.', $attribute, self::CALLBACKS));
0 commit comments