Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpKernel] Add support for custom HTTP status code for the#[MapQueryParameter] attribute#53209
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
carsonbot commentedDec 25, 2023
Hey! I see that this is your first PR. That is great! Welcome! Symfony has acontribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
src/Symfony/Component/HttpKernel/Controller/ArgumentResolver/QueryParameterValueResolver.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
#[MapQueryParameter] attributeUh oh!
There was an error while loading.Please reload this page.
…colas-grekas)This PR was merged into the 7.1 branch.Discussion----------[HttpKernel] Add `HttpException::fromStatusCode()`| Q | A| ------------- | ---| Branch? | 7.1| Bug fix? | no| New feature? | yes| Deprecations? | no| Issues | -| License | MITA small helper idea that popped up when reviewing#53209Commits-------98f4fa1 [HttpKernel] Add `HttpException::fromStatusCode()`
nicolas-grekas left a comment
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.
LGTM with one minor comment.
Uh oh!
There was an error while loading.Please reload this page.
…Parameter attribute
nicolas-grekas commentedJan 2, 2024
Thank you@ovidiuenache. |
Uh oh!
There was an error while loading.Please reload this page.
Issue#52782 was created where the need to have a custom HTTP status code for the MapQueryParameter attribute was stated. As part of the discussion,@nicolas-grekas suggested an approach similar to the implementation of the MapQueryString attribute where such a status code can be provided in the attribute's constructor.
I believe having the possibility to control the status code returned for an invalid and non-nullable parameter with no default value would be a great addition so I took the liberty to create this PR.
This change is backward compatible.