aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/TaskProcessing/ShapeDescriptor.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/TaskProcessing/ShapeDescriptor.php')
-rw-r--r--lib/public/TaskProcessing/ShapeDescriptor.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/public/TaskProcessing/ShapeDescriptor.php b/lib/public/TaskProcessing/ShapeDescriptor.php
index 58d4b5d8e7f..c84a638862d 100644
--- a/lib/public/TaskProcessing/ShapeDescriptor.php
+++ b/lib/public/TaskProcessing/ShapeDescriptor.php
@@ -6,7 +6,7 @@ namespace OCP\TaskProcessing;
* Data object for input output shape entries
* @since 30.0.0
*/
-class ShapeDescriptor {
+class ShapeDescriptor implements \JsonSerializable {
/**
* @param string $name
* @param string $description
@@ -43,4 +43,15 @@ class ShapeDescriptor {
public function getShapeType(): EShapeType {
return $this->shapeType;
}
+
+ /**
+ * @return array{name: string, description: string, type: int}
+ */
+ public function jsonSerialize(): array {
+ return [
+ 'name' => $this->getName(),
+ 'description' => $this->getDescription(),
+ 'type' => $this->getShapeType()->value,
+ ];
+ }
}