Skip to content

[HttpKernel] [Value Resolver] Added RequestPayloadValueResolver section #19293

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

Merged
merged 1 commit into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ attribute, arguments of your controller's action can be automatically fulfilled:
The :class:`Symfony\\Component\\HttpKernel\\Attribute\\MapQueryParameter` attribute
was introduced in Symfony 6.3.

.. _controller-mapping-query-string:

Mapping The Whole Query String
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -445,6 +447,8 @@ You can customize the validation groups used during the mapping thanks to the
The :class:`Symfony\\Component\\HttpKernel\\Attribute\\MapQueryString` attribute
was introduced in Symfony 6.3.

.. _controller-mapping-request-payload:

Mapping Request Payload
~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
15 changes: 15 additions & 0 deletions controller/value_resolver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,19 @@ Symfony ships with the following value resolvers in the

The ``BackedEnumValueResolver`` and ``EnumRequirement`` were introduced in Symfony 6.1.


:class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestPayloadValueResolver`
Maps the request payload or the query string into the type-hinted object.

Because this is a :ref:`targeted value resolver <value-resolver-targeted>`,
you'll have to use either the :ref:`MapRequestPayload <controller-mapping-request-payload>`
or the :ref:`MapQueryString <controller-mapping-query-string>` attribute
in order to use this resolver.

.. versionadded:: 6.3

The ``RequestPayloadValueResolver`` was introduced in Symfony 6.3.

:class:`Symfony\\Component\\HttpKernel\\Controller\\ArgumentResolver\\RequestAttributeValueResolver`
Attempts to find a request attribute that matches the name of the argument.

Expand Down Expand Up @@ -430,6 +443,8 @@ command to see which argument resolvers are present and in which order they run:
You can also configure the name passed to the ``ValueResolver`` attribute to target
your resolver. Otherwise it will default to the service's id.

.. _value-resolver-targeted:

``controller.targeted_value_resolver``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down