aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Veyssier <julien-nc@posteo.net>2024-07-24 16:01:01 +0200
committerJulien Veyssier <julien-nc@posteo.net>2024-07-25 10:10:32 +0200
commita2e531c34cf5bf26645cb09a9675a5d9129d2244 (patch)
treee89bc50b2f3536568e5fbd2674e451243a6d3008
parent0584ebf628837a81f536033c73540ffc24bc3c22 (diff)
downloadnextcloud-server-a2e531c34cf5bf26645cb09a9675a5d9129d2244.tar.gz
nextcloud-server-a2e531c34cf5bf26645cb09a9675a5d9129d2244.zip
fix(taskprocessing): fix OpenAPI error and generate specs
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
-rw-r--r--core/ResponseDefinitions.php4
-rw-r--r--core/openapi-full.json139
-rw-r--r--core/openapi.json139
3 files changed, 268 insertions, 14 deletions
diff --git a/core/ResponseDefinitions.php b/core/ResponseDefinitions.php
index 10386748c8d..7afddbe820a 100644
--- a/core/ResponseDefinitions.php
+++ b/core/ResponseDefinitions.php
@@ -176,10 +176,10 @@ use OCP\TaskProcessing\ShapeEnumValue;
* description: string,
* inputShape: CoreTaskProcessingShape[],
* inputShapeEnumValues: array{name: string, value: string}[][],
- * inputShapeDefaults: array<array-key, numeric|string>,
+ * inputShapeDefaults: array<string, numeric|string>,
* optionalInputShape: CoreTaskProcessingShape[],
* optionalInputShapeEnumValues: array{name: string, value: string}[][],
- * optionalInputShapeDefaults: array<array-key, numeric|string>,
+ * optionalInputShapeDefaults: array<string, numeric|string>,
* outputShape: CoreTaskProcessingShape[],
* outputShapeEnumValues: array{name: string, value: string}[][],
* optionalOutputShape: CoreTaskProcessingShape[],
diff --git a/core/openapi-full.json b/core/openapi-full.json
index a90cc1efaaf..e52b62d6fa6 100644
--- a/core/openapi-full.json
+++ b/core/openapi-full.json
@@ -496,8 +496,7 @@
"required": [
"name",
"description",
- "type",
- "mandatory"
+ "type"
],
"properties": {
"name": {
@@ -515,6 +514,7 @@
"Image",
"Video",
"File",
+ "Enum",
"ListOfNumbers",
"ListOfTexts",
"ListOfImages",
@@ -522,9 +522,6 @@
"ListOfVideos",
"ListOfFiles"
]
- },
- "mandatory": {
- "type": "boolean"
}
}
},
@@ -602,7 +599,15 @@
"name",
"description",
"inputShape",
- "outputShape"
+ "inputShapeEnumValues",
+ "inputShapeDefaults",
+ "optionalInputShape",
+ "optionalInputShapeEnumValues",
+ "optionalInputShapeDefaults",
+ "outputShape",
+ "outputShapeEnumValues",
+ "optionalOutputShape",
+ "optionalOutputShapeEnumValues"
],
"properties": {
"name": {
@@ -617,11 +622,133 @@
"$ref": "#/components/schemas/TaskProcessingShape"
}
},
+ "inputShapeEnumValues": {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "name",
+ "value"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "inputShapeDefaults": {
+ "type": "object",
+ "additionalProperties": {
+ "oneOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "string"
+ }
+ ]
+ }
+ },
+ "optionalInputShape": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/TaskProcessingShape"
+ }
+ },
+ "optionalInputShapeEnumValues": {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "name",
+ "value"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "optionalInputShapeDefaults": {
+ "type": "object",
+ "additionalProperties": {
+ "oneOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "string"
+ }
+ ]
+ }
+ },
"outputShape": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TaskProcessingShape"
}
+ },
+ "outputShapeEnumValues": {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "name",
+ "value"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "optionalOutputShape": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/TaskProcessingShape"
+ }
+ },
+ "optionalOutputShapeEnumValues": {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "name",
+ "value"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ }
+ }
+ }
}
}
},
diff --git a/core/openapi.json b/core/openapi.json
index 869bc4ef2c5..d597796f94e 100644
--- a/core/openapi.json
+++ b/core/openapi.json
@@ -496,8 +496,7 @@
"required": [
"name",
"description",
- "type",
- "mandatory"
+ "type"
],
"properties": {
"name": {
@@ -515,6 +514,7 @@
"Image",
"Video",
"File",
+ "Enum",
"ListOfNumbers",
"ListOfTexts",
"ListOfImages",
@@ -522,9 +522,6 @@
"ListOfVideos",
"ListOfFiles"
]
- },
- "mandatory": {
- "type": "boolean"
}
}
},
@@ -602,7 +599,15 @@
"name",
"description",
"inputShape",
- "outputShape"
+ "inputShapeEnumValues",
+ "inputShapeDefaults",
+ "optionalInputShape",
+ "optionalInputShapeEnumValues",
+ "optionalInputShapeDefaults",
+ "outputShape",
+ "outputShapeEnumValues",
+ "optionalOutputShape",
+ "optionalOutputShapeEnumValues"
],
"properties": {
"name": {
@@ -617,11 +622,133 @@
"$ref": "#/components/schemas/TaskProcessingShape"
}
},
+ "inputShapeEnumValues": {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "name",
+ "value"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "inputShapeDefaults": {
+ "type": "object",
+ "additionalProperties": {
+ "oneOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "string"
+ }
+ ]
+ }
+ },
+ "optionalInputShape": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/TaskProcessingShape"
+ }
+ },
+ "optionalInputShapeEnumValues": {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "name",
+ "value"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "optionalInputShapeDefaults": {
+ "type": "object",
+ "additionalProperties": {
+ "oneOf": [
+ {
+ "type": "number"
+ },
+ {
+ "type": "string"
+ }
+ ]
+ }
+ },
"outputShape": {
"type": "array",
"items": {
"$ref": "#/components/schemas/TaskProcessingShape"
}
+ },
+ "outputShapeEnumValues": {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "name",
+ "value"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "optionalOutputShape": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/TaskProcessingShape"
+ }
+ },
+ "optionalOutputShapeEnumValues": {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "required": [
+ "name",
+ "value"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ }
+ }
+ }
+ }
}
}
},