From 6782a79f122144291f675d460d159d3ef7df6c50 Mon Sep 17 00:00:00 2001 From: Ali Yousefi Date: Thu, 2 May 2024 19:03:12 +0330 Subject: [PATCH] Update controller.rst In use statement use wrong case, then this error happens 'Case mismatch between loaded and declared class names: "App\Model\UserDto" vs "App\Model\UserDTO". ', https://stackoverflow.com/questions/78352633/controller-returning-500-could-not-denormalize-object-of-type/78420166 --- controller.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controller.rst b/controller.rst index 436326aa700..1a46200ebdf 100644 --- a/controller.rst +++ b/controller.rst @@ -419,7 +419,7 @@ optional validation constraints:: You can then use the :class:`Symfony\\Component\\HttpKernel\\Attribute\\MapQueryString` attribute in your controller:: - use App\Model\UserDto; + use App\Model\UserDTO; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Attribute\MapQueryString; @@ -454,7 +454,7 @@ The default status code returned if the validation fails is 404. If you need a valid DTO even when the request query string is empty, set a default value for your controller arguments:: - use App\Model\UserDto; + use App\Model\UserDTO; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Attribute\MapQueryString; @@ -497,7 +497,7 @@ In this case, it is also possible to directly map this payload to your DTO by using the :class:`Symfony\\Component\\HttpKernel\\Attribute\\MapRequestPayload` attribute:: - use App\Model\UserDto; + use App\Model\UserDTO; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;