From dcf395a02c59d0f1f439886737e7652e958c1753 Mon Sep 17 00:00:00 2001 From: zak39 Date: Tue, 23 Dec 2025 15:11:21 +0100 Subject: [PATCH] docs(ocs): Improve OCS API Documentation for edit function OP#4418 --- lib/Controller/WorkspaceApiOcsController.php | 8 ++++---- openapi.json | 17 ++++++++++------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/Controller/WorkspaceApiOcsController.php b/lib/Controller/WorkspaceApiOcsController.php index 813d758f..248471df 100644 --- a/lib/Controller/WorkspaceApiOcsController.php +++ b/lib/Controller/WorkspaceApiOcsController.php @@ -150,9 +150,9 @@ public function find(int $id): DataResponse { * Edit workspace name, color and quota * * @param int $id Represents the ID of a workspace - * @param string|null $name Workspace name (optional) - * @param string|null $color Workspace color (optional) - * @param int|null $quota Workspace quota in bytes (optional, -3 means unlimited, 0 means no quota) + * @param string|null $name Optional - Workspace name. + * @param string|null $color Optional - Workspace color in hexadecimal format (example: #f91616). + * @param int|null $quota Optional - Workspace quota in bytes; e.g., 5368709120 for 5GB, or -3 for unlimited. * @return DataResponse * @throws OCSNotFoundException when no groupfolder is associated with the given space ID * @throws OCSException for all unknown errors @@ -171,7 +171,7 @@ public function find(int $id): DataResponse { url: '/api/v1/spaces/{id}', requirements: ['id' => '\d+'] )] - public function edit(int $id, ?string $name, ?string $color = null, ?int $quota = null): DataResponse { + public function edit(int $id, ?string $name = null, ?string $color = null, ?int $quota = null): DataResponse { $toSet = array_merge(WorkspaceEditParams::DEFAULT, [ 'name' => $name, 'color' => $color, diff --git a/openapi.json b/openapi.json index 6770a6e8..008e8b16 100644 --- a/openapi.json +++ b/openapi.json @@ -234,7 +234,7 @@ "/ocs/v2.php/apps/workspace/api/v1/spaces": { "get": { "operationId": "workspace_api_ocs-find-all", - "summary": "Return the first 30 workspaces (optional filtering by name)", + "summary": "Return the first 25 workspaces (optional filtering by name)", "tags": [ "workspace" ], @@ -257,13 +257,14 @@ } }, { - "name": "page", + "name": "offset", "in": "query", "description": "Optional page number for pagination", "schema": { "type": "integer", "format": "int64", - "nullable": true + "nullable": true, + "default": null } }, { @@ -273,7 +274,8 @@ "schema": { "type": "integer", "format": "int64", - "nullable": true + "nullable": true, + "default": null } }, { @@ -665,20 +667,21 @@ "name": { "type": "string", "nullable": true, - "description": "Workspace name (optional)" + "default": null, + "description": "Optional - Workspace name." }, "color": { "type": "string", "nullable": true, "default": null, - "description": "Workspace color (optional)" + "description": "Optional - Workspace color in hexadecimal format (example: #f91616)." }, "quota": { "type": "integer", "format": "int64", "nullable": true, "default": null, - "description": "Workspace quota in bytes (optional, -3 means unlimited, 0 means no quota)" + "description": "Optional - Workspace quota in bytes. For example: 5368709120 for 5GB or -3 means unlimited." } } }