Skip to content

Commit 48c8206

Browse files
committed
Fix openapi docs
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
1 parent b7c3b50 commit 48c8206

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

core/Controller/LanguageModelApiController.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function taskTypes(): DataResponse {
7171
* @param string $type The task type
7272
* @param string $appId The originating app ID
7373
* @param string $identifier An identifier to identify this task
74-
* @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{}>
74+
* @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{}>
7575
*
7676
* 200: Task scheduled
7777
* 400: Task type does not exist
@@ -86,8 +86,11 @@ public function schedule(string $input, string $type, string $appId, string $ide
8686
try {
8787
$this->languageModelManager->scheduleTask($task);
8888

89+
/** @var array{id: int|null, type: string, status: int, userId: string|null, appId: string, input: string, output: string|null, identifier: string} $json */
90+
$json = $task->jsonSerialize();
91+
8992
return new DataResponse([
90-
'task' => $task->jsonSerialize(),
93+
'task' => $json,
9194
]);
9295
} catch (PreConditionNotMetException) {
9396
return new DataResponse(['message' => $this->l->t('Necessary language model provider is not available')], Http::STATUS_PRECONDITION_FAILED);
@@ -100,7 +103,7 @@ public function schedule(string $input, string $type, string $appId, string $ide
100103
*
101104
* @PublicPage
102105
* @param int $id The id of the task
103-
* @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{}>
106+
* @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{}>
104107
*
105108
* 200: Task returned
106109
* 404: Task not found
@@ -114,8 +117,11 @@ public function getTask(int $id): DataResponse {
114117
return new DataResponse(['message' => $this->l->t('Task not found')], Http::STATUS_NOT_FOUND);
115118
}
116119

120+
/** @var array{id: int|null, type: string, status: int, userId: string|null, appId: string, input: string, output: string|null, identifier: string} $json */
121+
$json = $task->jsonSerialize();
122+
117123
return new DataResponse([
118-
'task' => $task->jsonSerialize(),
124+
'task' => $json,
119125
]);
120126
} catch (NotFoundException $e) {
121127
return new DataResponse(['message' => $this->l->t('Task not found')], Http::STATUS_NOT_FOUND);

0 commit comments

Comments
 (0)