FriendsOfSymfony / FOSRestBundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

Home Page:http://symfony.com/doc/master/bundles/FOSRestBundle/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use InputBag for Request::$request property when able

mbabker opened this issue · comments

The BodyListener attempts to decode a request and replaces the parameter bag with the decoded data. When introduced in Symfony 5.1, depending on the initialization path, the $request->request property could be either a ParameterBag or an InputBag, but in 5.3 the Request class was standardized and it always initializes an InputBag. This bundle should use an InputBag when the class is available when overwriting Request::$request.

Note, the current way of overriding the property could result in folks missing the deprecations the InputBag was introduced with regarding accessing array values from the request data, so ensuring the right object is in use could be important to not blindsiding folks with that one.