diff --git a/apps/files_sharing/lib/Controller/RemoteController.php b/apps/files_sharing/lib/Controller/RemoteController.php index 4b87db488b5..590ebdd5d94 100644 --- a/apps/files_sharing/lib/Controller/RemoteController.php +++ b/apps/files_sharing/lib/Controller/RemoteController.php @@ -108,16 +108,17 @@ class RemoteController extends OCSController { * @return Files_SharingRemoteShare Enriched share info with data from the filecache */ private function extendShareInfo(ExternalShare $share): array { + $shareData = $share->jsonSerialize(); + + $shareData['parent'] = $shareData['parent'] !== '-1' ? $shareData['parent'] : null; $userFolder = $this->rootFolder->getUserFolder($this->userId); try { $mountPointNode = $userFolder->get($share->getMountpoint()); } catch (\Exception) { - return $share->jsonSerialize(); + return $shareData; } - $shareData = $share->jsonSerialize(); - $shareData['mimetype'] = $mountPointNode->getMimetype(); $shareData['mtime'] = $mountPointNode->getMTime(); $shareData['permissions'] = $mountPointNode->getPermissions(); diff --git a/apps/files_sharing/lib/ResponseDefinitions.php b/apps/files_sharing/lib/ResponseDefinitions.php index 35e66c5d1f7..58277577eab 100644 --- a/apps/files_sharing/lib/ResponseDefinitions.php +++ b/apps/files_sharing/lib/ResponseDefinitions.php @@ -89,7 +89,7 @@ namespace OCA\Files_Sharing; * mtime: int|null, * name: string, * owner: string, - * parent: string, + * parent: string|null, * permissions: int|null, * remote: string, * remote_id: string, diff --git a/apps/files_sharing/openapi.json b/apps/files_sharing/openapi.json index d2e80654ce3..dc89752f091 100644 --- a/apps/files_sharing/openapi.json +++ b/apps/files_sharing/openapi.json @@ -408,7 +408,8 @@ ], "properties": { "accepted": { - "type": "boolean" + "type": "integer", + "format": "int64" }, "file_id": { "type": "integer", diff --git a/openapi.json b/openapi.json index 94b9dfd8569..7aff72d29a1 100644 --- a/openapi.json +++ b/openapi.json @@ -2515,7 +2515,8 @@ ], "properties": { "accepted": { - "type": "boolean" + "type": "integer", + "format": "int64" }, "file_id": { "type": "integer",