Merge pull request #39315 from nextcloud/feature/openapi/dav

dav: Add OpenAPI spec
This commit is contained in:
Kate 2023-07-11 20:13:52 +02:00 committed by GitHub
commit 46247e670a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 0 deletions

View file

@ -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
*
@ -33,6 +34,9 @@ class Capabilities implements ICapability {
$this->config = $config;
}
/**
* @return array{dav: array{chunking: string, bulkupload?: string}}
*/
public function getCapabilities() {
$capabilities = [
'dav' => [

View file

@ -7,6 +7,7 @@ declare(strict_types=1);
*
* @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
*
@ -28,6 +29,7 @@ namespace OCA\DAV\Controller;
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 @@ class DirectController extends OCSController {
/**
* @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);

View file

@ -8,6 +8,7 @@ declare(strict_types=1);
* @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
*
@ -29,6 +30,7 @@ namespace OCA\DAV\Controller;
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 OCP\IRequest;
use Sabre\VObject\ITip\Message;
use Sabre\VObject\Reader;
#[IgnoreOpenAPI]
class InvitationResponseController extends Controller {
/** @var IDBConnection */