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:
Carl Schwan 2025-12-10 11:05:40 +01:00
parent a011cb7780
commit 18964750f9
No known key found for this signature in database
GPG key ID: 02325448204E452A
4 changed files with 9 additions and 6 deletions

View file

@ -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();

View file

@ -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,

View file

@ -408,7 +408,8 @@
],
"properties": {
"accepted": {
"type": "boolean"
"type": "integer",
"format": "int64"
},
"file_id": {
"type": "integer",

View file

@ -2515,7 +2515,8 @@
],
"properties": {
"accepted": {
"type": "boolean"
"type": "integer",
"format": "int64"
},
"file_id": {
"type": "integer",