-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Why InputBag
in parameters shouldn't support array as value?
#44788
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
Comments
See #34363 for an explanation. Allowing scalar and non-scalar return values leads to 500's (unless you explicitly check the return type every time you fetch a value from the bag). The input values (get, post, request, cookie) only support scalar values in the HTTP spec if I recall correctly. Other related issues about this topic: #41766 #40315 #37265 #37100 I've opened #44789 as I believe we missed something in this long list of issues/PRs. Other than that, I feel like there is little to do here. If you have any more questions on how to use Request with JSON bodies, please use one of the support channels (e.g. Slack or GitHub Discussions): https://symfony.com/support |
InputBag::get should only return scalar values, when an array is needed InputBag::all should be used. See symfony/symfony#44788
InputBag::get should only return scalar values, when an array is needed InputBag::all should be used. Like it or not. See symfony/symfony#44788 Needed for the upgrade to symfony 6
* chore: fix deprecation in InputBag::get InputBag::get should only return scalar values, when an array is needed InputBag::all should be used. See symfony/symfony#44788 * style: Apply php-cs-fixer --------- Co-authored-by: Demos-CI <[email protected]>
Description
Definition:
For api (via json), value-array in parameter is simple case ... why override parent
get
in InputBag?Array of
ids
in$_POST
\$_GET
is this a problem?Or what to do in this case?
Example
No response
The text was updated successfully, but these errors were encountered: