diff options
author | Marcel Klehr <mklehr@gmx.net> | 2024-05-14 10:01:09 +0200 |
---|---|---|
committer | Marcel Klehr <mklehr@gmx.net> | 2024-05-14 11:38:42 +0200 |
commit | cac812dc580079f2772623641ba70985714ad7b2 (patch) | |
tree | 55251f2baa2c66aacd44919542b568efa2abefa1 /core | |
parent | f5a8bda1bad42e2ecc0e5601171a5f0967de65fa (diff) | |
download | nextcloud-server-cac812dc580079f2772623641ba70985714ad7b2.tar.gz nextcloud-server-cac812dc580079f2772623641ba70985714ad7b2.zip |
fix: address review comments
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'core')
-rw-r--r-- | core/ResponseDefinitions.php | 8 | ||||
-rw-r--r-- | core/openapi.json | 92 |
2 files changed, 48 insertions, 52 deletions
diff --git a/core/ResponseDefinitions.php b/core/ResponseDefinitions.php index 23d89b25adf..6b537a3c461 100644 --- a/core/ResponseDefinitions.php +++ b/core/ResponseDefinitions.php @@ -180,7 +180,7 @@ namespace OCA\Core; * @psalm-type CoreTaskProcessingShape = array{ * name: string, * description: string, - * type: int, + * type: "Number"|"Text"|"Audio"|"Image"|"Video"|"File"|"ListOfNumbers"|"ListOfTexts"|"ListOfImages"|"ListOfAudios"|"ListOfVideos"|"ListOfFiles", * mandatory: bool, * } * @@ -191,14 +191,16 @@ namespace OCA\Core; * outputShape: CoreTaskProcessingShape[], * } * + * @psalm-type CoreTaskProcessingIO = array<string, numeric|list<numeric>|string|list<string>> + * * @psalm-type CoreTaskProcessingTask = array{ * id: int, * type: string, * status: 'STATUS_CANCELLED'|'STATUS_FAILED'|'STATUS_SUCCESSFUL'|'STATUS_RUNNING'|'STATUS_SCHEDULED'|'STATUS_UNKNOWN', * userId: ?string, * appId: string, - * input: array<string, numeric|list<numeric>|string|list<string>>, - * output: null|array<string, numeric|list<numeric>|string|list<string>>, + * input: CoreTaskProcessingIO, + * output: null|CoreTaskProcessingIO, * customId: ?string, * completionExpectedAt: ?int, * progress: ?float diff --git a/core/openapi.json b/core/openapi.json index c6802be5491..d4067eac3cd 100644 --- a/core/openapi.json +++ b/core/openapi.json @@ -466,6 +466,31 @@ } } }, + "TaskProcessingIO": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "array", + "items": { + "type": "number" + } + }, + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, "TaskProcessingShape": { "type": "object", "required": [ @@ -482,8 +507,21 @@ "type": "string" }, "type": { - "type": "integer", - "format": "int64" + "type": "string", + "enum": [ + "Number", + "Text", + "Audio", + "Image", + "Video", + "File", + "ListOfNumbers", + "ListOfTexts", + "ListOfImages", + "ListOfAudios", + "ListOfVideos", + "ListOfFiles" + ] }, "mandatory": { "type": "boolean" @@ -531,55 +569,11 @@ "type": "string" }, "input": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "array", - "items": { - "type": "number" - } - }, - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - } + "$ref": "#/components/schemas/TaskProcessingIO" }, "output": { - "type": "object", - "nullable": true, - "additionalProperties": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "array", - "items": { - "type": "number" - } - }, - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - } + "$ref": "#/components/schemas/TaskProcessingIO", + "nullable": true }, "customId": { "type": "string", |