Skip to content

Commit a1449c7

Browse files
mrossardsoyuka
authored andcommitted
fix(symfony): explicitly map the resource of the current operation in the ObjectMapperProcessor
1 parent bf0cc0e commit a1449c7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/State/Processor/ObjectMapperProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ public function process(mixed $data, Operation $operation, array $uriVariables =
4242
return $this->decorated->process($data, $operation, $uriVariables, $context);
4343
}
4444

45-
return $this->objectMapper->map($this->decorated->process($this->objectMapper->map($data), $operation, $uriVariables, $context));
45+
return $this->objectMapper->map($this->decorated->process($this->objectMapper->map($data), $operation, $uriVariables, $context), $operation->getClass());
4646
}
4747
}

tests/Functional/MappingTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ public function testShouldMapBetweenResourceAndEntity(): void
7373

7474
public function testShouldMapToTheCorrectResource(): void
7575
{
76+
if ('mongodb' === $this->isMongoDB()) {
77+
$this->markTestSkipped('MongoDB not tested.');
78+
}
79+
7680
if (!$this->getContainer()->has('object_mapper')) {
7781
$this->markTestSkipped('ObjectMapper not installed');
7882
}

0 commit comments

Comments
 (0)