From 6153c3a806a10963d7dc65ca2c4e84d6805e8d45 Mon Sep 17 00:00:00 2001 From: lukmzig Date: Tue, 10 Dec 2024 14:45:02 +0100 Subject: [PATCH] add some missing internal error responses --- src/Asset/Controller/GetController.php | 3 ++- .../Grid/Configuration/GetAvailableColumnsController.php | 3 ++- .../Grid/Configuration/GetConfigurationController.php | 3 ++- .../Grid/Configuration/ListSavedConfigurationsController.php | 1 + src/Asset/Controller/Image/ThumbnailDownloadController.php | 3 ++- src/Asset/Controller/TreeController.php | 3 ++- 6 files changed, 11 insertions(+), 5 deletions(-) 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 {