Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hello everyone

I have a controller method like this : someMethod(#[MapRequestPayload] UpdateBalanceSettingsInput $input) { dump($input); }

`final readonly class UpdateBalanceSettingsInput
{
public function __construct(
/**
* @var BalanceSettingInput[]
*/
public array $settings
){}

}`

and BalanceSettingInput like this

class BalanceSettingInput { public function __construct( public int $id, public bool $active ){} }

The problem is that when getting datas from the request through the MapRequestPayload, instead of having in UpdateBalanceSettingsInput an array of BalanceSettingInput, I get an array of arrays... I tried to rollback to Symfony 7.2 and it reworked perfectly, so I'm sure the problem was introduced by the update to 7.3.

Same problem is here https://www.reddit.com/r/symfony/comments/1nebngt/mapquerybuilder_in_73_parsing_problem/

You must be logged in to vote

Replies: 1 comment

Comment options

Hello, could you share the corresponding request payload?

Note that since Symfony 7.1 you can map an array using MapRequestPayload’s type option: https://symfony.com/doc/current/controller.html#mapping-request-payload

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.