From cbe3c578e1bb14442aed3c3e8acc0f0f9f9d59f8 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Mon, 20 Mar 2023 18:46:52 +0100 Subject: [PATCH] dav: Add OpenAPI spec Signed-off-by: jld3103 --- apps/dav/lib/Capabilities.php | 4 ++++ apps/dav/lib/Controller/DirectController.php | 13 +++++++++++++ .../lib/Controller/InvitationResponseController.php | 3 +++ 3 files changed, 20 insertions(+) diff --git a/apps/dav/lib/Capabilities.php b/apps/dav/lib/Capabilities.php index b8096d3395ab5..f61fb5d2f0a73 100644 --- a/apps/dav/lib/Capabilities.php +++ b/apps/dav/lib/Capabilities.php @@ -5,6 +5,7 @@ * @author Thomas Müller * @author Louis Chemineau * @author Côme Chilliet + * @author Kate Döen * * @license AGPL-3.0 * @@ -33,6 +34,9 @@ public function __construct(IConfig $config) { $this->config = $config; } + /** + * @return array{dav: array{chunking: string, bulkupload?: string}} + */ public function getCapabilities() { $capabilities = [ 'dav' => [ diff --git a/apps/dav/lib/Controller/DirectController.php b/apps/dav/lib/Controller/DirectController.php index f9c83488935c4..1a7b3b5762684 100644 --- a/apps/dav/lib/Controller/DirectController.php +++ b/apps/dav/lib/Controller/DirectController.php @@ -7,6 +7,7 @@ * * @author Iscle * @author Roeland Jago Douma + * @author Kate Döen * * @license GNU AGPL version 3 or any later version * @@ -28,6 +29,7 @@ use OCA\DAV\Db\Direct; use OCA\DAV\Db\DirectMapper; +use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\OCS\OCSBadRequestException; use OCP\AppFramework\OCS\OCSNotFoundException; @@ -88,6 +90,17 @@ public function __construct(string $appName, /** * @NoAdminRequired + * + * Get a direct link to a file + * + * @param int $fileId ID of the file + * @param int $expirationTime Duration until the link expires + * @return DataResponse + * @throws OCSNotFoundException File not found + * @throws OCSBadRequestException Getting direct link is not possible + * @throws OCSForbiddenException Missing permissions to get direct link + * + * 200: Direct link returned */ public function getUrl(int $fileId, int $expirationTime = 60 * 60 * 8): DataResponse { $userFolder = $this->rootFolder->getUserFolder($this->userId); diff --git a/apps/dav/lib/Controller/InvitationResponseController.php b/apps/dav/lib/Controller/InvitationResponseController.php index a360794987413..3cf2e6586215a 100644 --- a/apps/dav/lib/Controller/InvitationResponseController.php +++ b/apps/dav/lib/Controller/InvitationResponseController.php @@ -8,6 +8,7 @@ * @author Christoph Wurst * @author Georg Ehrke * @author Joas Schilling + * @author Kate Döen * * @license GNU AGPL version 3 or any later version * @@ -29,6 +30,7 @@ use OCA\DAV\CalDAV\InvitationResponse\InvitationResponseServer; use OCP\AppFramework\Controller; +use OCP\AppFramework\Http\Attribute\IgnoreOpenAPI; use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Utility\ITimeFactory; use OCP\IDBConnection; @@ -36,6 +38,7 @@ use Sabre\VObject\ITip\Message; use Sabre\VObject\Reader; +#[IgnoreOpenAPI] class InvitationResponseController extends Controller { /** @var IDBConnection */