Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
bohanyang committed Aug 2, 2023
1 parent 5935fec commit a264793
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/mango/HttpKernel/DtoInitializerValueResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ public function resolve(Request $request, ArgumentMetadata $argument): iterable

$objectToPopulate = $initializer(...$arguments);

$serializationContext = $request->attributes->get('denormalization_context', []) + [AbstractObjectNormalizer::OBJECT_TO_POPULATE => $objectToPopulate];

$attribute = null === $objectToPopulate ? $attribute : new MapRequestPayload(
$attribute->acceptFormat,
$attribute->serializationContext + [AbstractObjectNormalizer::OBJECT_TO_POPULATE => $objectToPopulate],
$attribute->serializationContext + $serializationContext,
$attribute->validationGroups,
);

Expand Down

0 comments on commit a264793

Please sign in to comment.