aboutsummaryrefslogtreecommitdiffstats
path: root/core/Controller/TaskProcessingApiController.php
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2024-05-08 09:20:25 +0200
committerMarcel Klehr <mklehr@gmx.net>2024-05-14 11:38:41 +0200
commitec94a672d72720530ffcfce92f9695d8b9a09e27 (patch)
tree2c19545ffe0bbbdf49e5f2a5b54f85f86c293ead /core/Controller/TaskProcessingApiController.php
parenteff862b583450d870f8dd452181ebb6606a519cc (diff)
downloadnextcloud-server-ec94a672d72720530ffcfce92f9695d8b9a09e27.tar.gz
nextcloud-server-ec94a672d72720530ffcfce92f9695d8b9a09e27.zip
fix(ocs): change /tasktypes response to combine optional and non-optional IO slots
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'core/Controller/TaskProcessingApiController.php')
-rw-r--r--core/Controller/TaskProcessingApiController.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/core/Controller/TaskProcessingApiController.php b/core/Controller/TaskProcessingApiController.php
index 9e0d7947a3a..6c06d17cef0 100644
--- a/core/Controller/TaskProcessingApiController.php
+++ b/core/Controller/TaskProcessingApiController.php
@@ -83,10 +83,14 @@ class TaskProcessingApiController extends \OCP\AppFramework\OCSController {
$serializedTaskTypes[$key] = [
'name' => $taskType['name'],
'description' => $taskType['description'],
- 'inputShape' => array_map(fn (ShapeDescriptor $descriptor) => $descriptor->jsonSerialize(), $taskType['inputShape']),
- 'optionalInputShape' => array_map(fn (ShapeDescriptor $descriptor) => $descriptor->jsonSerialize(), $taskType['optionalInputShape']),
- 'outputShape' => array_map(fn (ShapeDescriptor $descriptor) => $descriptor->jsonSerialize(), $taskType['outputShape']),
- 'optionalOutputShape' => array_map(fn (ShapeDescriptor $descriptor) => $descriptor->jsonSerialize(), $taskType['optionalOutputShape']),
+ 'inputShape' => array_map(fn (ShapeDescriptor $descriptor) =>
+ $descriptor->jsonSerialize() + ['mandatory' => true], $taskType['inputShape'])
+ + array_map(fn (ShapeDescriptor $descriptor) =>
+ $descriptor->jsonSerialize() + ['mandatory' => false], $taskType['optionalInputShape']),
+ 'outputShape' => array_map(fn (ShapeDescriptor $descriptor) =>
+ $descriptor->jsonSerialize() + ['mandatory' => true], $taskType['outputShape'])
+ + array_map(fn (ShapeDescriptor $descriptor) =>
+ $descriptor->jsonSerialize() + ['mandatory' => false], $taskType['optionalOutputShape']),
];
}