Skip to content
2 changes: 1 addition & 1 deletion src/Tempest/Http/src/Mappers/PsrRequestToRequestMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function map(mixed $from, mixed $to): array|object
'path' => $from->getUri()->getPath(),
'query' => $query,
'files' => $uploads,
...$data,
...$data + $uploads,
])->to($requestClass);

$validator = new Validator();
Expand Down
4 changes: 2 additions & 2 deletions src/Tempest/Mapper/src/Mappers/ArrayToObjectMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ private function resolveValueFromArray(

$caster = $this->casterFactory->forProperty($property);

foreach ($data as $item) {
foreach ($data as $key => $item) {
if (! is_array($item)) {
$values[] = $caster?->cast($item) ?? $item;
$values[$key] = $caster?->cast($item) ?? $item;

continue;
}
Expand Down