From ec94a672d72720530ffcfce92f9695d8b9a09e27 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Wed, 8 May 2024 09:20:25 +0200 Subject: fix(ocs): change /tasktypes response to combine optional and non-optional IO slots Signed-off-by: Marcel Klehr --- core/Controller/TaskProcessingApiController.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'core/Controller/TaskProcessingApiController.php') 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']), ]; } -- cgit v1.2.3