Closed as not planned
Closed as not planned
Description
Description
Right now, the QueryParameterValueResolver
throws a NotFoundHttpException
if the parameter could not be mapped successfully because of filter settings or providing a wrong value for a backed enum.
We would like to return "400 Bad Request" responses instead. Ideally this would be a parameter in the MapQueryParameter
attribute same as for the MapQueryString
or MapRequestPayload
attributes where this already exists in $validationFailedStatusCode = Response::HTTP_NOT_FOUND
.
Example
Before:
#[Route("/hello")]
public function action(
#[MapQueryParameter] MyBackedEnum $option,
): Response
{
// ...
}
After:
#[Route("/hello")]
public function action(
#[MapQueryParameter(validationFailedStatusCode: Response::HTTP_BAD_REQUEST)] MyBackedEnum $option,
): Response
{
// ...
}