-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel] Map a list of items with MapRequestPayload
attribute
#54385
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
Conversation
ef669f4
to
24f3cc7
Compare
Couple of questions there:
|
The feature behind this improvement is completely agnostic to the request format. It will work with any data format supported by the Serializer component. See more here: https://symfony.com/doc/current/components/serializer.html#handling-arrays
Yes, the validator component does support any iterable value. |
I did not see how a form could send data as flat array at first... hence my question. But i'm indeed not aware of all the possibilties offered by the serializer there. (for the validation i was referring to the |
If set, it will be applied to each element of the collection as implemented here: symfony/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php Line 332 in 78c6ceb
|
24f3cc7
to
39e1651
Compare
src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/RequestPayloadValueResolver.php
Outdated
Show resolved
Hide resolved
42bbd07
to
38a7cdd
Compare
src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/RequestPayloadValueResolver.php
Outdated
Show resolved
Hide resolved
38a7cdd
to
948e65b
Compare
src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/RequestPayloadValueResolver.php
Outdated
Show resolved
Hide resolved
948e65b
to
00ec79a
Compare
src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/RequestPayloadValueResolver.php
Outdated
Show resolved
Hide resolved
00ec79a
to
5bca3e0
Compare
At some point, the new TypeInfo component could certainly help guessing what |
src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/RequestPayloadValueResolver.php
Outdated
Show resolved
Hide resolved
5bca3e0
to
3f72143
Compare
Nice one. Thanks Yonel! |
…e (yceruto) This PR was merged into the 7.1 branch. Discussion ---------- Documenting items type in the MapRequestPayload attribute Fixes #19761 PR: symfony/symfony#54385 Commits ------- fa1934c Documenting items type in the MapRequestPayload attribute
Request:
Controller:
Cheers!