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>
pull/55369/head
Carl Schwan 8 months ago
parent a011cb7780
commit 18964750f9
No known key found for this signature in database
GPG Key ID: 02325448204E452A
  1. 7
      apps/files_sharing/lib/Controller/RemoteController.php
  2. 2
      apps/files_sharing/lib/ResponseDefinitions.php
  3. 3
      apps/files_sharing/openapi.json
  4. 3
      openapi.json

@ -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…
Cancel
Save