-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel] Enhance MapRequestPayload adding format and validation group #50029
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
nicolas-grekas
merged 1 commit into
symfony:6.3
from
renanbr:map-request-content-enhancement
Apr 20, 2023
Merged
[HttpKernel] Enhance MapRequestPayload adding format and validation group #50029
nicolas-grekas
merged 1 commit into
symfony:6.3
from
renanbr:map-request-content-enhancement
Apr 20, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30810f6
to
3ae9131
Compare
ro0NL
reviewed
Apr 17, 2023
src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/RequestPayloadValueResolver.php
Outdated
Show resolved
Hide resolved
ro0NL
reviewed
Apr 17, 2023
src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/RequestPayloadValueResolver.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpKernel/Attribute/MapRequestPayload.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/RequestPayloadValueResolver.php
Outdated
Show resolved
Hide resolved
3ae9131
to
d3a290f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost GTM
src/Symfony/Component/HttpKernel/Attribute/MapRequestPayload.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpKernel/Attribute/MapRequestPayload.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/RequestPayloadValueResolver.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/RequestPayloadValueResolver.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/RequestPayloadValueResolver.php
Outdated
Show resolved
Hide resolved
ba63b5b
to
820d1b1
Compare
...y/Component/HttpKernel/Tests/Controller/ArgumentResolver/RequestPayloadValueResolverTest.php
Show resolved
Hide resolved
820d1b1
to
a7a403c
Compare
nicolas-grekas
approved these changes
Apr 19, 2023
...y/Component/HttpKernel/Tests/Controller/ArgumentResolver/RequestPayloadValueResolverTest.php
Outdated
Show resolved
Hide resolved
a7a403c
to
191a579
Compare
…roup apply feedbacks revert argument type better properties name attempt to fix CI static providers
191a579
to
068fb4d
Compare
Thank you @renanbr. |
fabpot
added a commit
that referenced
this pull request
Apr 21, 2023
…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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR enhances
MapRequestPayload
(merged via #49138) by allowing users to restrict format and pick validation groups.