Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mazumba opened this issue Jun 12, 2024 · 0 comments · Fixed by #2298
Closed

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

mazumba opened this issue Jun 12, 2024 · 0 comments · Fixed by #2298
Labels

Comments

@mazumba
Copy link
Contributor

mazumba commented Jun 12, 2024

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

@mazumba mazumba added the bug label Jun 12, 2024
mazumba pushed a commit to mazumba/NelmioApiDocBundle that referenced this issue Jun 12, 2024
mazumba pushed a commit to mazumba/NelmioApiDocBundle that referenced this issue Jun 12, 2024
mazumba pushed a commit to mazumba/NelmioApiDocBundle that referenced this issue Jun 12, 2024
mazumba pushed a commit to mazumba/NelmioApiDocBundle that referenced this issue Jun 12, 2024
mazumba pushed a commit to mazumba/NelmioApiDocBundle that referenced this issue Jun 17, 2024
mazumba pushed a commit to mazumba/NelmioApiDocBundle that referenced this issue Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant