aboutsummaryrefslogtreecommitdiffstats
path: root/core/Controller/PreviewController.php
diff options
context:
space:
mode:
authorjld3103 <jld3103yt@gmail.com>2023-03-15 17:29:32 +0100
committerjld3103 <jld3103yt@gmail.com>2023-07-13 07:24:15 +0200
commit1be836273ddba6e0ddb3509a1d898535df9fd169 (patch)
tree5aa57fed3c2173484ffcd082f61aaef5015fc3f3 /core/Controller/PreviewController.php
parent706c141fffce928d344fe2f039da549fad065393 (diff)
downloadnextcloud-server-1be836273ddba6e0ddb3509a1d898535df9fd169.tar.gz
nextcloud-server-1be836273ddba6e0ddb3509a1d898535df9fd169.zip
core: Add OpenAPI spec
Signed-off-by: jld3103 <jld3103yt@gmail.com>
Diffstat (limited to 'core/Controller/PreviewController.php')
-rw-r--r--core/Controller/PreviewController.php32
1 files changed, 29 insertions, 3 deletions
diff --git a/core/Controller/PreviewController.php b/core/Controller/PreviewController.php
index 38373e2d147..c9183466f90 100644
--- a/core/Controller/PreviewController.php
+++ b/core/Controller/PreviewController.php
@@ -54,7 +54,20 @@ class PreviewController extends Controller {
* @NoAdminRequired
* @NoCSRFRequired
*
- * @return DataResponse|FileDisplayResponse
+ * Get a preview by file path
+ *
+ * @param string $file Path of the file
+ * @param int $x Width of the preview
+ * @param int $y Height of the preview
+ * @param bool $a Whether to not crop the preview
+ * @param bool $forceIcon Force returning an icon
+ * @param string $mode How to crop the image
+ * @return FileDisplayResponse<Http::STATUS_OK, array{Content-Type: string}>|DataResponse<Http::STATUS_BAD_REQUEST|Http::STATUS_FORBIDDEN|Http::STATUS_NOT_FOUND, array<empty>, array{}>
+ *
+ * 200: Preview returned
+ * 400: Getting preview is not possible
+ * 403: Getting preview is not allowed
+ * 404: Preview not found
*/
public function getPreview(
string $file = '',
@@ -81,7 +94,20 @@ class PreviewController extends Controller {
* @NoAdminRequired
* @NoCSRFRequired
*
- * @return DataResponse|FileDisplayResponse
+ * Get a preview by file ID
+ *
+ * @param int $fileId ID of the file
+ * @param int $x Width of the preview
+ * @param int $y Height of the preview
+ * @param bool $a Whether to not crop the preview
+ * @param bool $forceIcon Force returning an icon
+ * @param string $mode How to crop the image
+ * @return FileDisplayResponse<Http::STATUS_OK, array{Content-Type: string}>|DataResponse<Http::STATUS_BAD_REQUEST|Http::STATUS_FORBIDDEN|Http::STATUS_NOT_FOUND, array<empty>, array{}>
+ *
+ * 200: Preview returned
+ * 400: Getting preview is not possible
+ * 403: Getting preview is not allowed
+ * 404: Preview not found
*/
public function getPreviewByFileId(
int $fileId = -1,
@@ -107,7 +133,7 @@ class PreviewController extends Controller {
}
/**
- * @return DataResponse|FileDisplayResponse
+ * @return FileDisplayResponse<Http::STATUS_OK, array{Content-Type: string}>|DataResponse<Http::STATUS_BAD_REQUEST|Http::STATUS_FORBIDDEN|Http::STATUS_NOT_FOUND, array<empty>, array{}>
*/
private function fetchPreview(
Node $node,