From 6f5119c0938d949fceb1e0f17508a2a96effdc7f Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Tue, 11 Jul 2023 14:37:14 +0200 Subject: Fix openapi docs Signed-off-by: Marcel Klehr (cherry picked from commit 48c820653840a50f7c67801418222b718e9be40b) --- core/Controller/LanguageModelApiController.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'core/Controller') 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| DataResponse + * @return DataResponse| DataResponse * * 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 | DataResponse + * @return DataResponse | DataResponse * * 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); -- cgit v1.2.3