{
  "$schema": "https://json-schema.org/draft-04/schema#",
  "id": "https://api.dataplatform.ibm.com/schemas/common-canvas/expression/function-list-v3-schema.json",
  "title": "Function List",
  "description": "Function List Schema for the Common Properties editor",
  "type": "object",
  "properties": {
    "function_categories": {
      "description": "Array of categories of functions",
      "type": "array",
      "minItems": 0,
      "items": {
        "$ref": "#/definitions/function_categories_def"
      },
      "uniqueItems": true
    },
    "operator_refs": {
      "description": "Array of refs to functions that will be displayed as operators.",
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "function_info": {
      "description": "Array of function information",
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/definitions/function_def"
      },
      "uniqueItems": true
    }
  },
  "required": [
    "function_categories",
    "function_info"
  ],
  "definitions": {
    "function_categories_def": {
      "description": "Definition of a information about a function",
      "type": "object",
      "properties": {
        "id": {
          "description": "Unique string to reference this category",
          "type": "string"
        },
        "label": {
          "description": "External name of category",
          "type": "object",
          "$ref": "https://api.dataplatform.ibm.com/schemas/common-pipeline/operators/uihints-v3-schema.json#/definitions/resource_definition"
        },
        "function_refs": {
          "description": "Array of function ids that are part of this fuction category",
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string"
          },
          "uniqueItems": true
        }
      },
      "required": [
        "label",
        "function_refs"
      ],
      "additionalProperties": false
    },
    "function_def": {
      "description": "Definition of a information about a function",
      "type": "object",
      "properties": {
        "id": {
          "description": "Unique string to reference this function",
          "type": "string"
        },
        "label": {
          "description": "User-readable name of function",
          "type": "object",
          "$ref": "https://api.dataplatform.ibm.com/schemas/common-pipeline/operators/uihints-v3-schema.json#/definitions/resource_definition"
        },
        "parameters": {
          "description": "Array of parameter information",
          "type": "array",
          "minItems": 0,
          "items": {
            "$ref": "#/definitions/function_parameter_def"
          },
          "uniqueItems": false
        },
        "return_type_label": {
          "description": "Translatable data type name of what is returned from the function. If this is not provided, default to return_type",
          "type": "object",
          "$ref": "https://api.dataplatform.ibm.com/schemas/common-pipeline/operators/uihints-v3-schema.json#/definitions/resource_definition"
        },
        "return_type": {
          "description": "The data type name of what is returned from the function.",
          "type": "string"
        },
        "description": {
          "description": "The help text for the function.",
          "type": "object",
          "$ref": "https://api.dataplatform.ibm.com/schemas/common-pipeline/operators/uihints-v3-schema.json#/definitions/resource_definition"
        }
      },
      "required": [
        "id",
        "label",
        "return_type"
      ],
      "additionalProperties": false
    },
    "function_parameter_def": {
      "description": "Definition of a information about a functions parameters.",
      "type": "object",
      "properties": {
        "label": {
          "description": "User-readable name of parameter",
          "type": "object",
          "$ref": "https://api.dataplatform.ibm.com/schemas/common-pipeline/operators/uihints-v3-schema.json#/definitions/resource_definition"
        },
        "type": {
          "description": "The type of the parameter.",
          "type": "string"
        }
      },
      "required": [
        "label"
      ]
    }
  }
}
