Skip to content

Commit 278097b

Browse files
committed
fix(state): never map a response
1 parent c857b52 commit 278097b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/State/Processor/ObjectMapperProcessor.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use ApiPlatform\Metadata\Operation;
1717
use ApiPlatform\State\ProcessorInterface;
1818
use Symfony\Component\ObjectMapper\ObjectMapperInterface;
19+
use Symfony\Component\HttpFoundation\Response;
1920

2021
/**
2122
* @implements ProcessorInterface<mixed,mixed>
@@ -36,7 +37,8 @@ public function process(mixed $data, Operation $operation, array $uriVariables =
3637
$class = $operation->getInput()['class'] ?? $operation->getClass();
3738

3839
if (
39-
!$this->objectMapper
40+
$data instanceof Response
41+
|| !$this->objectMapper
4042
|| !$operation->canWrite()
4143
|| null === $data
4244
|| !is_a($data, $class, true)

0 commit comments

Comments
 (0)