Skip to content
\n

Controller

\n
public function updateBalanceSettings(\n    #[MapRequestPayload] UpdateBalanceSettingsInput $input\n): Response {\n    dump($input);\n    exit;\n}
\n

DTOs

\n
final readonly class UpdateBalanceSettingsInput\n{\n    public function __construct(\n        /** @var BalanceSettingInput[] */\n        public array $settings,\n    ) {}\n}\n\nclass BalanceSettingInput\n{\n    public function __construct(\n        public int $id,\n        public bool $active,\n    ) {}\n}
\n

Dump (Symfony 7.2)

\n
App\\UI\\Web\\DTO\\Cabinet\\Balance\\UpdateBalanceSettingsInput {#1961\n  +settings: array:1 [\n    0 => App\\UI\\Web\\DTO\\Cabinet\\Balance\\BalanceSettingInput {#1964\n      +id: 2\n      +active: true\n    }\n  ]\n}
\n

Dump (Symfony 7.3)

\n
App\\UI\\Web\\DTO\\Cabinet\\Balance\\UpdateBalanceSettingsInput {#1613\n  +settings: array:1 [\n    0 => array:2 [\n      \"id\" => 2\n      \"active\" => true\n    ]\n  ]\n}
\n

Expected Behavior
\nThe settings property should still contain an array of BalanceSettingInput objects,
\nbut since Symfony 7.3 it now returns an array of raw arrays instead.

\n

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

","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"

Ah this may be the same issue than #60795; could you try setting framework.property_info.with_constructor_extractor to false?

","upvoteCount":0,"url":"https://github.com/symfony/symfony/discussions/62045#discussioncomment-14676611"}}}
Discussion options

You must be logged in to vote

Ah this may be the same issue than #60795; could you try setting framework.property_info.with_constructor_extractor to false?

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@scion4581
Comment options

@MatTheCat
Comment options

@scion4581
Comment options

@MatTheCat
Comment options

Answer selected by scion4581
@scion4581
Comment options

@MatTheCat
Comment options

@xavierleune
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants