aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2023-07-11 14:37:14 +0200
committerMarcel Klehr <mklehr@gmx.net>2023-07-11 14:37:14 +0200
commit48c820653840a50f7c67801418222b718e9be40b (patch)
treee2f88def0bf418d9fccfe3a2525ef9836b6250ff /core
parentb7c3b50e411bf949a73f551af6d8582bdf390b08 (diff)
downloadnextcloud-server-48c820653840a50f7c67801418222b718e9be40b.tar.gz
nextcloud-server-48c820653840a50f7c67801418222b718e9be40b.zip
Fix openapi docs
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'core')
-rw-r--r--core/Controller/LanguageModelApiController.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/core/Controller/LanguageModelApiController.php b/core/Controller/LanguageModelApiController.php
index b343cb4315b..f2a510bec80 100644
--- a/core/Controller/LanguageModelApiController.php
+++ b/core/Controller/LanguageModelApiController.php
@@ -71,7 +71,7 @@ class LanguageModelApiController extends \OCP\AppFramework\OCSController {
* @param string $type The task type
* @param string $appId The originating app ID
* @param string $identifier An identifier to identify this task
- * @return DataResponse<Http::STATUS_OK, array{task: array{id: int, type: string, status: int, userId: string, appId: string, input: string, output: string, identifier: string}}, array{}>| DataResponse<Http::STATUS_PRECONDITION_FAILED|Http::STATUS_BAD_REQUEST, array{message: string}, array{}>
+ * @return DataResponse<Http::STATUS_OK, array{task: array{id: int|null, type: string, status: int, userId: string|null, appId: string, input: string, output: string|null, identifier: string}}, array{}>| DataResponse<Http::STATUS_PRECONDITION_FAILED|Http::STATUS_BAD_REQUEST, array{message: string}, array{}>
*
* 200: Task scheduled
* 400: Task type does not exist
@@ -86,8 +86,11 @@ class LanguageModelApiController extends \OCP\AppFramework\OCSController {
try {
$this->languageModelManager->scheduleTask($task);
+ /** @var array{id: int|null, type: string, status: int, userId: string|null, appId: string, input: string, output: string|null, identifier: string} $json */
+ $json = $task->jsonSerialize();
+
return new DataResponse([
- 'task' => $task->jsonSerialize(),
+ 'task' => $json,
]);
} catch (PreConditionNotMetException) {
return new DataResponse(['message' => $this->l->t('Necessary language model provider is not available')], Http::STATUS_PRECONDITION_FAILED);
@@ -100,7 +103,7 @@ class LanguageModelApiController extends \OCP\AppFramework\OCSController {
*
* @PublicPage
* @param int $id The id of the task
- * @return DataResponse<Http::STATUS_NOT_FOUND | Http::STATUS_INTERNAL_SERVER_ERROR, array{message:string}> | DataResponse<Http::STATUS_OK, array{task: array{id: int, type: string, status: int, userId: string, appId: string, input: string, output: string, identifier: string}}, array{}>
+ * @return DataResponse<Http::STATUS_NOT_FOUND | Http::STATUS_INTERNAL_SERVER_ERROR, array{message:string}, array{}> | DataResponse<Http::STATUS_OK, array{task: array{id: int|null, type: string, status: int, userId: string|null, appId: string, input: string, output: string|null, identifier: string}}, array{}>
*
* 200: Task returned
* 404: Task not found
@@ -114,8 +117,11 @@ class LanguageModelApiController extends \OCP\AppFramework\OCSController {
return new DataResponse(['message' => $this->l->t('Task not found')], Http::STATUS_NOT_FOUND);
}
+ /** @var array{id: int|null, type: string, status: int, userId: string|null, appId: string, input: string, output: string|null, identifier: string} $json */
+ $json = $task->jsonSerialize();
+
return new DataResponse([
- 'task' => $task->jsonSerialize(),
+ 'task' => $json,
]);
} catch (NotFoundException $e) {
return new DataResponse(['message' => $this->l->t('Task not found')], Http::STATUS_NOT_FOUND);