Open
Description
Description
I've noticed that MapRequestPayload cannot handle the array
type hint.
Request payload:
[{"field": "value1"}, {"field": "value2"}]
public function someAction(
#[MapRequestPayload]
/** @param ItemDto[] $items */
array $items
) {}
This is because the $type
parameter passed to Serializer::denormalize() in RequestPayloadValueResolver is taken from ArgumentMetadata and the type there is taken from \ReflectionParameter so no DocBlocks are considered.
I was checking out if I can override the type with a serializer's context options (you can pass that to MapRequestPayload attribute) but it looks like it's not possible.
Example
No response