Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[HttpKernel] Add option to map empty data withMapQueryString andMapRequestPayload#52134

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
Jeroeny wants to merge1 commit intosymfony:7.4
base:7.4
Choose a base branch
Loading
fromJeroeny:mapempty

Conversation

Jeroeny
Copy link
Contributor

@JeroenyJeroeny commentedOct 18, 2023
edited
Loading

QA
Branch?6.4
Bug fix?no
New feature?yes
Deprecations?no
LicenseMIT

It would be nice if theRequestPayloadValueResolver could optionally call theserializer->denormalize method regardless if$request->query,$request->request or$request->getContent() is empty.

Because if a DTO/request has optional arguments combined with some system-provided arguments, the data could be empty while the controller may still require this DTO class.

Also in cases where there are only required arguments, it is beneficial for the user to see which request arguments are needed. ThePartialDenormalizationException may show this.

For example:

Where the$userId is provided by a custom normalizer that retrieves it from the Symfony Security User object. If$name isn't passed in the request, the class won't be constructed.

class GetUserQuery {    __construct(privateUuid$userId, private ?string$name =null) {}}

odolbeau and blaugueux reacted with thumbs up emoji
…for always attempting denormalization with empty query and request payload
Copy link
Contributor

@Victor-TruhanovichVictor-Truhanovich left a comment

Choose a reason for hiding this comment

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

It is excellent, necessary and useful pull request

Victor-Truhanovich and blaugueux reacted with thumbs up emoji
@Victor-Truhanovich
Copy link
Contributor

@nicolas-grekas May I know when this PR will be accepted and merged?

blaugueux reacted with thumbs up emoji

@xabbuhxabbuh modified the milestones:7.1,7.2May 15, 2024
@fabpotfabpot modified the milestones:7.2,7.3Nov 20, 2024
@fabpotfabpot modified the milestones:7.3,7.4May 26, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@Victor-TruhanovichVictor-TruhanovichVictor-Truhanovich approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
7.4
Development

Successfully merging this pull request may close these issues.

6 participants
@Jeroeny@Victor-Truhanovich@fabpot@nicolas-grekas@xabbuh@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp