Skip to content

Commit

Permalink
Merge pull request #39315 from nextcloud/feature/openapi/dav
Browse files Browse the repository at this point in the history
dav: Add OpenAPI spec
  • Loading branch information
provokateurin committed Jul 11, 2023
2 parents ee1ba9a + cbe3c57 commit 46247e6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/dav/lib/Capabilities.php
Expand Up @@ -5,6 +5,7 @@
* @author Thomas Müller <thomas.mueller@tmit.eu>
* @author Louis Chemineau <louis@chmn.me>
* @author Côme Chilliet <come.chilliet@nextcloud.com>
* @author Kate Döen <kate.doeen@nextcloud.com>
*
* @license AGPL-3.0
*
Expand Down Expand Up @@ -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' => [
Expand Down
13 changes: 13 additions & 0 deletions apps/dav/lib/Controller/DirectController.php
Expand Up @@ -7,6 +7,7 @@
*
* @author Iscle <albertiscle9@gmail.com>
* @author Roeland Jago Douma <roeland@famdouma.nl>
* @author Kate Döen <kate.doeen@nextcloud.com>
*
* @license GNU AGPL version 3 or any later version
*
Expand All @@ -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;
Expand Down Expand Up @@ -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<Http::STATUS_OK, array{url: string}, array{}>
* @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);
Expand Down
3 changes: 3 additions & 0 deletions apps/dav/lib/Controller/InvitationResponseController.php
Expand Up @@ -8,6 +8,7 @@
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @author Georg Ehrke <oc.list@georgehrke.com>
* @author Joas Schilling <coding@schilljs.com>
* @author Kate Döen <kate.doeen@nextcloud.com>
*
* @license GNU AGPL version 3 or any later version
*
Expand All @@ -29,13 +30,15 @@

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;
use OCP\IRequest;
use Sabre\VObject\ITip\Message;
use Sabre\VObject\Reader;

#[IgnoreOpenAPI]
class InvitationResponseController extends Controller {

/** @var IDBConnection */
Expand Down

0 comments on commit 46247e6

Please sign in to comment.