Skip to content

Keep #[MapUploadedFile] working and map payloads after controller attributes - #4

Merged
yceruto merged 1 commit into
open-solid:mainfrom
nicolas-grekas:native-request-mapping
Oct 6, 2026
Merged

yceruto merged 1 commit into
open-solid:mainfrom
nicolas-grekas:native-request-mapping

Conversation

@nicolas-grekas

Copy link
Copy Markdown
Contributor

Hi @yceruto, I found these while checking who decorates argument_resolver.request_payload for symfony/symfony#66634.

RequestPayloadArrayResolver replaces the core resolver, so #[MapUploadedFile] arguments can't be resolved when the bundle is installed. They're now delegated to the decorated resolver.

It also maps payloads at priority 0, while Symfony 8.1 runs controller attributes like #[IsGranted] at -10000 and maps payloads at -10100 (symfony/symfony#64449). A malformed payload then gets a 400 or a 422 instead of a 403. The resolver now reuses the priority of the decorated one.

And symfony/browser-kit: ^8.0 prevented the PHP 8.2 and 8.3 jobs from installing, so 7.4 wasn't tested anymore. Tests pass on both 7.4 and 8.1.

…ributes

`RequestPayloadArrayResolver` decorates `argument_resolver.request_payload` and replaces it, so `#[MapUploadedFile]` arguments could not be resolved anymore. They are now delegated to the decorated resolver.

The resolver also mapped payloads at priority 0 on `kernel.controller_arguments`. Since Symfony 8.1, controller attributes such as `#[IsGranted]` run at -10000, so a malformed payload got a 400 or a 422 before the request was denied. It now uses the priority of the decorated resolver.

`symfony/browser-kit` accepts 7.4 again so that the PHP 8.2 and 8.3 jobs can install.
@yceruto
yceruto requested a balanced review from Copilot October 6, 2026 09:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@yceruto yceruto left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nicolas-grekas for taking care of this 🤟

@yceruto
yceruto merged commit 9d4eea4 into open-solid:main Oct 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants