]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(taskprocessing): fix OpenAPI error and generate specs
authorJulien Veyssier <julien-nc@posteo.net>
Wed, 24 Jul 2024 14:01:01 +0000 (16:01 +0200)
committerJulien Veyssier <julien-nc@posteo.net>
Thu, 25 Jul 2024 08:10:32 +0000 (10:10 +0200)
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
core/ResponseDefinitions.php
core/openapi-full.json
core/openapi.json

index 10386748c8dd33926890429321e3f8c707d09354..7afddbe820a0fb6ea48c986ced039cf31a1f7b58 100644 (file)
@@ -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[],
index a90cc1efaafb5d38c8e8732d751de5ec2f18c60b..e52b62d6fa60d4552d7f3d377f07aaf5e6d3d1fb 100644 (file)
                 "required": [
                     "name",
                     "description",
-                    "type",
-                    "mandatory"
+                    "type"
                 ],
                 "properties": {
                     "name": {
                             "Image",
                             "Video",
                             "File",
+                            "Enum",
                             "ListOfNumbers",
                             "ListOfTexts",
                             "ListOfImages",
                             "ListOfVideos",
                             "ListOfFiles"
                         ]
-                    },
-                    "mandatory": {
-                        "type": "boolean"
                     }
                 }
             },
                     "name",
                     "description",
                     "inputShape",
-                    "outputShape"
+                    "inputShapeEnumValues",
+                    "inputShapeDefaults",
+                    "optionalInputShape",
+                    "optionalInputShapeEnumValues",
+                    "optionalInputShapeDefaults",
+                    "outputShape",
+                    "outputShapeEnumValues",
+                    "optionalOutputShape",
+                    "optionalOutputShapeEnumValues"
                 ],
                 "properties": {
                     "name": {
                             "$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"
+                                    }
+                                }
+                            }
+                        }
                     }
                 }
             },
index 869bc4ef2c5fe01bc3ff5c080ce9aa7e991d7039..d597796f94e24e3e9dc15aa160373b21d1082c52 100644 (file)
                 "required": [
                     "name",
                     "description",
-                    "type",
-                    "mandatory"
+                    "type"
                 ],
                 "properties": {
                     "name": {
                             "Image",
                             "Video",
                             "File",
+                            "Enum",
                             "ListOfNumbers",
                             "ListOfTexts",
                             "ListOfImages",
                             "ListOfVideos",
                             "ListOfFiles"
                         ]
-                    },
-                    "mandatory": {
-                        "type": "boolean"
                     }
                 }
             },
                     "name",
                     "description",
                     "inputShape",
-                    "outputShape"
+                    "inputShapeEnumValues",
+                    "inputShapeDefaults",
+                    "optionalInputShape",
+                    "optionalInputShapeEnumValues",
+                    "optionalInputShapeDefaults",
+                    "outputShape",
+                    "outputShapeEnumValues",
+                    "optionalOutputShape",
+                    "optionalOutputShapeEnumValues"
                 ],
                 "properties": {
                     "name": {
                             "$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"
+                                    }
+                                }
+                            }
+                        }
                     }
                 }
             },