From c6806684d2deee11b64fb8250064115cea291659 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Wed, 15 Feb 2023 19:22:09 +0100 Subject: files_sharing: Add OpenAPI spec Signed-off-by: jld3103 --- .../lib/Controller/PublicPreviewController.php | 30 +++++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'apps/files_sharing/lib/Controller/PublicPreviewController.php') diff --git a/apps/files_sharing/lib/Controller/PublicPreviewController.php b/apps/files_sharing/lib/Controller/PublicPreviewController.php index ee11cf5f3f0..089610f711f 100644 --- a/apps/files_sharing/lib/Controller/PublicPreviewController.php +++ b/apps/files_sharing/lib/Controller/PublicPreviewController.php @@ -5,6 +5,7 @@ * @author Julius Härtl * @author Morris Jobke * @author Roeland Jago Douma + * @author Kate Döen * * @license GNU AGPL version 3 or any later version * @@ -82,11 +83,19 @@ class PublicPreviewController extends PublicShareController { * @PublicPage * @NoCSRFRequired * - * @param string $file - * @param int $x - * @param int $y - * @param bool $a - * @return DataResponse|FileDisplayResponse + * Get a preview for a shared file + * + * @param string $token Token of the share + * @param string $file File in the share + * @param int $x Width of the preview + * @param int $y Height of the preview + * @param bool $a Whether to not crop the preview + * @return FileDisplayResponse|DataResponse, array{}> + * + * 200: Preview returned + * 400: Getting preview is not possible + * 403: Getting preview is not allowed + * 404: Share or preview not found */ public function getPreview( string $token, @@ -138,8 +147,15 @@ class PublicPreviewController extends PublicShareController { * @NoCSRFRequired * @NoSameSiteCookieRequired * - * @param $token - * @return DataResponse|FileDisplayResponse + * Get a direct link preview for a shared file + * + * @param string $token Token of the share + * @return FileDisplayResponse|DataResponse, array{}> + * + * 200: Preview returned + * 400: Getting preview is not possible + * 403: Getting preview is not allowed + * 404: Share or preview not found */ public function directLink(string $token) { // No token no image -- cgit v1.2.3