mirror of
https://github.com/nextcloud/server.git
synced 2025-12-18 15:56:14 -05:00
fix(openapi): Fix returned types from external share
We always been returning an int for for accepted, but since it was returned as a mixed from the DB, psalm never complained about the fact this was typed as a bool in the API doc. Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
This commit is contained in:
parent
a011cb7780
commit
18964750f9
4 changed files with 9 additions and 6 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -408,7 +408,8 @@
|
|||
],
|
||||
"properties": {
|
||||
"accepted": {
|
||||
"type": "boolean"
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
"file_id": {
|
||||
"type": "integer",
|
||||
|
|
|
|||
|
|
@ -2515,7 +2515,8 @@
|
|||
],
|
||||
"properties": {
|
||||
"accepted": {
|
||||
"type": "boolean"
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
"file_id": {
|
||||
"type": "integer",
|
||||
|
|
|
|||
Loading…
Reference in a new issue