Skip to content

Commit bc426bc

Browse files
committed
fix(serializer): unwrap doctrine proxies when pinning the concrete input class
1 parent 673239d commit bc426bc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Serializer/AbstractItemNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a
280280
// which lacks subclass-only properties (and thus their types). The concrete is the
281281
// discriminator-resolved $type on a fresh denormalization, or the class of the object
282282
// being populated (e.g. PATCH), where $type is left as the abstract base.
283-
$concreteClass = null !== $objectToPopulate ? $objectToPopulate::class : $type;
283+
$concreteClass = null !== $objectToPopulate ? $this->getObjectClass($objectToPopulate) : $type;
284284
if ($concreteClass !== $context['resource_class']) {
285285
$resourceClass = $concreteClass;
286286
$context['resource_class'] = $concreteClass;

0 commit comments

Comments
 (0)