diff --git a/src/Asset/Controller/GetController.php b/src/Asset/Controller/GetController.php index e1601d5b..99686f6b 100644 --- a/src/Asset/Controller/GetController.php +++ b/src/Asset/Controller/GetController.php @@ -64,8 +64,9 @@ public function __construct( content: new OneOfAssetJson() )] #[DefaultResponses([ - HttpResponseCodes::UNAUTHORIZED, + HttpResponseCodes::BAD_REQUEST, HttpResponseCodes::NOT_FOUND, + HttpResponseCodes::UNAUTHORIZED, ])] public function getAssetById(int $id): JsonResponse { diff --git a/src/Asset/Controller/Grid/Configuration/GetAvailableColumnsController.php b/src/Asset/Controller/Grid/Configuration/GetAvailableColumnsController.php index 41ed6747..82d6ba9f 100644 --- a/src/Asset/Controller/Grid/Configuration/GetAvailableColumnsController.php +++ b/src/Asset/Controller/Grid/Configuration/GetAvailableColumnsController.php @@ -75,8 +75,9 @@ public function __construct( ) )] #[DefaultResponses([ - HttpResponseCodes::UNAUTHORIZED, + HttpResponseCodes::BAD_REQUEST, HttpResponseCodes::NOT_FOUND, + HttpResponseCodes::UNAUTHORIZED, ])] public function getAvailableAssetGridColumns(): JsonResponse { diff --git a/src/Asset/Controller/Grid/Configuration/GetConfigurationController.php b/src/Asset/Controller/Grid/Configuration/GetConfigurationController.php index 39df175c..865bed4a 100644 --- a/src/Asset/Controller/Grid/Configuration/GetConfigurationController.php +++ b/src/Asset/Controller/Grid/Configuration/GetConfigurationController.php @@ -72,8 +72,9 @@ public function __construct( content: new JsonContent(ref: DetailedConfiguration::class) )] #[DefaultResponses([ - HttpResponseCodes::UNAUTHORIZED, + HttpResponseCodes::BAD_REQUEST, HttpResponseCodes::NOT_FOUND, + HttpResponseCodes::UNAUTHORIZED, ])] public function getAssetGridConfiguration( int $folderId, diff --git a/src/Asset/Controller/Grid/Configuration/ListSavedConfigurationsController.php b/src/Asset/Controller/Grid/Configuration/ListSavedConfigurationsController.php index 33abb845..25bc66f0 100644 --- a/src/Asset/Controller/Grid/Configuration/ListSavedConfigurationsController.php +++ b/src/Asset/Controller/Grid/Configuration/ListSavedConfigurationsController.php @@ -72,6 +72,7 @@ public function __construct( content: new CollectionJson(new GenericCollection(Configuration::class)) )] #[DefaultResponses([ + HttpResponseCodes::BAD_REQUEST, HttpResponseCodes::UNAUTHORIZED, HttpResponseCodes::NOT_FOUND, ])] diff --git a/src/Asset/Controller/Image/ThumbnailDownloadController.php b/src/Asset/Controller/Image/ThumbnailDownloadController.php index e4017552..201e2392 100644 --- a/src/Asset/Controller/Image/ThumbnailDownloadController.php +++ b/src/Asset/Controller/Image/ThumbnailDownloadController.php @@ -82,8 +82,9 @@ public function __construct( headers: [new ContentDisposition()] )] #[DefaultResponses([ - HttpResponseCodes::UNAUTHORIZED, + HttpResponseCodes::BAD_REQUEST, HttpResponseCodes::NOT_FOUND, + HttpResponseCodes::UNAUTHORIZED, ])] public function downloadImageByThumbnail(int $id, string $thumbnailName): BinaryFileResponse { diff --git a/src/Asset/Controller/TreeController.php b/src/Asset/Controller/TreeController.php index a0fb4728..26d68593 100644 --- a/src/Asset/Controller/TreeController.php +++ b/src/Asset/Controller/TreeController.php @@ -88,8 +88,9 @@ public function __construct( content: new CollectionJson(new AnyOfAsset()) )] #[DefaultResponses([ - HttpResponseCodes::UNAUTHORIZED, + HttpResponseCodes::BAD_REQUEST, HttpResponseCodes::NOT_FOUND, + HttpResponseCodes::UNAUTHORIZED, ])] public function getAssetTree(#[MapQueryString] ElementParameters $parameters): JsonResponse { diff --git a/src/Role/Controller/CloneController.php b/src/Role/Controller/CloneController.php index 9d14d768..3cf23551 100644 --- a/src/Role/Controller/CloneController.php +++ b/src/Role/Controller/CloneController.php @@ -71,6 +71,7 @@ public function __construct( )] #[DefaultResponses([ HttpResponseCodes::NOT_FOUND, + HttpResponseCodes::INTERNAL_SERVER_ERROR, ])] public function cloneRole(int $id, #[MapRequestPayload] RoleCloneParameter $roleClone): JsonResponse { diff --git a/src/Role/Controller/CreateFolderController.php b/src/Role/Controller/CreateFolderController.php index 7d9ac688..4b9e14ed 100644 --- a/src/Role/Controller/CreateFolderController.php +++ b/src/Role/Controller/CreateFolderController.php @@ -66,6 +66,7 @@ public function __construct( )] #[DefaultResponses([ HttpResponseCodes::NOT_FOUND, + HttpResponseCodes::INTERNAL_SERVER_ERROR, ])] public function createRoleFolder(#[MapRequestPayload] CreateParameter $createParameter): JsonResponse { diff --git a/src/Role/Controller/CreateRoleController.php b/src/Role/Controller/CreateRoleController.php index 2a104e4f..bb2d7aca 100644 --- a/src/Role/Controller/CreateRoleController.php +++ b/src/Role/Controller/CreateRoleController.php @@ -66,6 +66,7 @@ public function __construct( )] #[DefaultResponses([ HttpResponseCodes::NOT_FOUND, + HttpResponseCodes::INTERNAL_SERVER_ERROR, ])] public function createRole(#[MapRequestPayload] CreateParameter $createParameter): JsonResponse { diff --git a/src/Role/Controller/DeleteFolderController.php b/src/Role/Controller/DeleteFolderController.php index e382172d..8e14587a 100644 --- a/src/Role/Controller/DeleteFolderController.php +++ b/src/Role/Controller/DeleteFolderController.php @@ -59,6 +59,7 @@ public function __construct( #[IdParameter(type: 'folder')] #[DefaultResponses([ HttpResponseCodes::NOT_FOUND, + HttpResponseCodes::INTERNAL_SERVER_ERROR, ])] public function deleteRoleFolder(int $id): Response { diff --git a/src/Role/Controller/DeleteRoleController.php b/src/Role/Controller/DeleteRoleController.php index 744d140c..12345b7a 100644 --- a/src/Role/Controller/DeleteRoleController.php +++ b/src/Role/Controller/DeleteRoleController.php @@ -60,6 +60,7 @@ public function __construct( #[IdParameter(type: 'role')] #[DefaultResponses([ HttpResponseCodes::NOT_FOUND, + HttpResponseCodes::INTERNAL_SERVER_ERROR, ])] public function deleteRole(int $id): Response { diff --git a/src/Role/Controller/GetRoleController.php b/src/Role/Controller/GetRoleController.php index 2e9ecf81..b81b890f 100644 --- a/src/Role/Controller/GetRoleController.php +++ b/src/Role/Controller/GetRoleController.php @@ -67,6 +67,7 @@ public function __construct( )] #[DefaultResponses([ HttpResponseCodes::NOT_FOUND, + HttpResponseCodes::INTERNAL_SERVER_ERROR, ])] public function getRoleById(int $id): JsonResponse { diff --git a/src/Role/Controller/RoleTreeController.php b/src/Role/Controller/RoleTreeController.php index 71a4d829..79fbef62 100644 --- a/src/Role/Controller/RoleTreeController.php +++ b/src/Role/Controller/RoleTreeController.php @@ -28,6 +28,7 @@ use Pimcore\Bundle\StudioBackendBundle\OpenApi\Config\Tags; use Pimcore\Bundle\StudioBackendBundle\OpenApi\Schema\TreeNode; use Pimcore\Bundle\StudioBackendBundle\Role\Service\RoleServiceInterface; +use Pimcore\Bundle\StudioBackendBundle\Util\Constant\HttpResponseCodes; use Pimcore\Bundle\StudioBackendBundle\Util\Constant\UserPermissions; use Pimcore\Bundle\StudioBackendBundle\Util\Trait\PaginatedResponseTrait; use Symfony\Component\HttpFoundation\Response; @@ -71,7 +72,9 @@ public function __construct( description: 'role_get_tree_success_response', content: new CollectionJson(new GenericCollection(TreeNode::class)) )] - #[DefaultResponses] + #[DefaultResponses([ + HttpResponseCodes::INTERNAL_SERVER_ERROR, + ])] public function getRoleTree(#[MapQueryString] MappedParentIdParameter $roleTreeListingParameter): Response { $roles = $this->roleService->getRoleTreeCollection($roleTreeListingParameter); diff --git a/src/Role/Controller/UpdateRoleController.php b/src/Role/Controller/UpdateRoleController.php index da7e0303..16c9ca13 100644 --- a/src/Role/Controller/UpdateRoleController.php +++ b/src/Role/Controller/UpdateRoleController.php @@ -74,6 +74,7 @@ public function __construct( )] #[DefaultResponses([ HttpResponseCodes::NOT_FOUND, + HttpResponseCodes::INTERNAL_SERVER_ERROR, ])] public function updateRoleById(int $id, #[MapRequestPayload] UpdateRoleParameter $roleUpdate): JsonResponse { diff --git a/src/User/Controller/CloneController.php b/src/User/Controller/CloneController.php index ec492424..6c62ff76 100644 --- a/src/User/Controller/CloneController.php +++ b/src/User/Controller/CloneController.php @@ -74,6 +74,7 @@ public function __construct( )] #[DefaultResponses([ HttpResponseCodes::NOT_FOUND, + HttpResponseCodes::INTERNAL_SERVER_ERROR, ])] public function cloneUser(int $id, #[MapRequestPayload] UserCloneParameter $userClone): JsonResponse { diff --git a/src/User/Controller/CreateUserController.php b/src/User/Controller/CreateUserController.php index e9a3a372..0cfa5345 100644 --- a/src/User/Controller/CreateUserController.php +++ b/src/User/Controller/CreateUserController.php @@ -69,6 +69,7 @@ public function __construct( )] #[DefaultResponses([ HttpResponseCodes::NOT_FOUND, + HttpResponseCodes::INTERNAL_SERVER_ERROR, ])] public function createUser(#[MapRequestPayload] CreateParameter $createParameter): JsonResponse { diff --git a/src/User/Controller/CreateUserFolderController.php b/src/User/Controller/CreateUserFolderController.php index 60422991..264090cc 100644 --- a/src/User/Controller/CreateUserFolderController.php +++ b/src/User/Controller/CreateUserFolderController.php @@ -69,6 +69,7 @@ public function __construct( )] #[DefaultResponses([ HttpResponseCodes::NOT_FOUND, + HttpResponseCodes::INTERNAL_SERVER_ERROR, ])] public function createUserFolder(#[MapRequestPayload] CreateParameter $createParameter): JsonResponse { diff --git a/src/User/Controller/DeleteUserFolderController.php b/src/User/Controller/DeleteUserFolderController.php index 02475bde..3dcf35f8 100644 --- a/src/User/Controller/DeleteUserFolderController.php +++ b/src/User/Controller/DeleteUserFolderController.php @@ -63,6 +63,7 @@ public function __construct( #[IdParameter(type: 'user-folder')] #[DefaultResponses([ HttpResponseCodes::NOT_FOUND, + HttpResponseCodes::INTERNAL_SERVER_ERROR, ])] public function deleteUserFolder(int $id): Response { diff --git a/src/User/Controller/UpdateUserController.php b/src/User/Controller/UpdateUserController.php index f40d66b6..f3e0d806 100644 --- a/src/User/Controller/UpdateUserController.php +++ b/src/User/Controller/UpdateUserController.php @@ -79,6 +79,7 @@ public function __construct( #[DefaultResponses([ HttpResponseCodes::NOT_FOUND, HttpResponseCodes::FORBIDDEN, + HttpResponseCodes::INTERNAL_SERVER_ERROR, ])] public function updateUsers(int $id, #[MapRequestPayload] UpdateUserParameter $userUpdate): JsonResponse {