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
if (!$this->serializerinstanceof DenormalizerInterface) {
460
-
thrownewLogicException(sprintf('Cannot denormalize attribute "%s" for class "%s" because injected serializer is not a denormalizer.', $attribute, $class));
459
+
// This try-catch should cover all NotNormalizableValueException (and all return branches after the first
460
+
// exception) so we could try denormalizing all types of an union type. If the target type is not an union
461
+
// type, we will just re-throw the catched exception.
462
+
// In the case of no denormalization succeeds with an union type, it will fall back to the default exception
463
+
// with the acceptable types list.
464
+
try {
465
+
if (Type::BUILTIN_TYPE_OBJECT === $builtinType) {
466
+
if (!$this->serializerinstanceof DenormalizerInterface) {
467
+
thrownewLogicException(sprintf('Cannot denormalize attribute "%s" for class "%s" because injected serializer is not a denormalizer.', $attribute, $class));
0 commit comments