Replies: 1 comment
-
Hello, could you share the corresponding request payload? Note that since Symfony 7.1 you can map an array using |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
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/
Beta Was this translation helpful? Give feedback.
All reactions