Skip to content

Request::getPayload(): Return value must be of type InputBag, ParameterBag returned #47834

Closed
@Gummibeer

Description

@Gummibeer

Laravel Version

10.16.0

PHP Version

8.1.19

Database Driver & Version

No response

Description

Symfony\Component\HttpFoundation\Request::getPayload(): Return value must be of type Symfony\Component\HttpFoundation\InputBag, Symfony\Component\HttpFoundation\ParameterBag returned

This error now occurs as soon as Laravel tries to handle any JSON request. This seems to be based on the new symfony/psr-http-message-bridge v2.3.0 release.

But originally it seems like a far longer problem just never detected. With Symfony 6 types were added - so also to the Symfony\Component\HttpFoundation\Request::getPayload() method. But for Laravel 9 the payload of JSON requests was filled into a ParameterBag. All places not checking for explicit type won't have any problem as these classes have nearly identical APIs.

Steps To Reproduce

Send a JSON request to the server with "symfony/psr-http-message-bridge": "2.3.0" installed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions