nelmio/NelmioApiDocBundle

[Bug]: Symfony 7.1 - MapRequestPayload resolves array with new "type" parameter

mazumba opened this issue · 0 comments

Version

4.26.2

Description

Since Symfony 7.1, the MapRequestPayload has a new parameter type that allows for array parameters to be resolved in a Controller. Link to the docs: https://symfony.com/doc/7.1/controller.html#mapping-request-payload

public function dashboard(
    #[MapRequestPayload(type: UserDTO::class)] array $users
): Response
{
    // ...
}

This currently results in an error "Schema of type "\array" can't be generated, no describer supports it". And could be resolved by checking for the type parameter of the MapRequestPayload attribute aswell as checking whether the Controller parameter is of type array in the SymfonyMapRequestPayloadDescriber->describe function .

Additional context

No response