You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #50082 [HttpKernel] Enhance MapQueryString adding validation group (renanbr)
This PR was merged into the 6.3 branch.
Discussion
----------
[HttpKernel] Enhance MapQueryString adding validation group
| Q | A
| ------------- | ---
| Branch? | 6.3
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | continuity of #50029 and #49138
| License | MIT
| Doc PR | n/a
- Introduces `$validationGroups` property to the `MapQueryString` attribute to work as same as in `MapRequestPayload`
- Renames `MapQueryString` property `$context` to `$serializationContext` to harmonize with `MapRequestPayload`
```php
# src/Controller/HelloController.php
namespace App\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Attribute\AsController;
use Symfony\Component\HttpKernel\Attribute\MapQueryString;
use Symfony\Component\Routing\Annotation\Route;
#[AsController]
final class HelloController
{
#[Route('/hello', methods: ['GET'])]
public function __invoke(
#[MapQueryString(validationGroups: 'strict')] MyObject $object,
): Response {
// ...
}
}
```
Commits
-------
8aad8b9 [HttpKernel] Enhance MapQueryString adding validation group
0 commit comments