Skip to content
Merged
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
26 changes: 26 additions & 0 deletions controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,32 @@ if you want to map a nested array of specific DTOs::
) {}
}

Nevertheless, if you want to send the array of payloads directly like this:

.. code-block:: json

[
{
"firstName": "John",
"lastName": "Smith",
"age": 28
},
{
"firstName": "Jane",
"lastName": "Doe",
"age": 30
}
]

Map the parameter as an array and configure the type of each element in the attribute::

public function dashboard(
#[MapRequestPayload(type: UserDTO::class)] array $users
): Response
{
// ...
}

Managing the Session
--------------------

Expand Down