Skip to content

Commit 11d74db

Browse files
committed
fix(metadata): enhance resource class determination before Object Mapper Processor return
1 parent 2a34498 commit 11d74db

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/State/Processor/ObjectMapperProcessor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,13 @@ public function process(mixed $data, Operation $operation, array $uriVariables =
5757
);
5858

5959
$request?->attributes->set('persisted_data', $persisted);
60+
$outputClass = $operation->getOutput()['class'] ?? $operation->getClass();
6061

6162
// return the Resource representation of the persisted entity
6263
return $this->objectMapper->map(
6364
// persist the entity
6465
$persisted,
65-
$operation->getClass()
66+
$outputClass
6667
);
6768
}
6869
}

0 commit comments

Comments
 (0)