{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "additionalProperties": false,
    "definitions": {
        "IEduFcInterfaceType": {
            "enum": [
                "any",
                "array",
                "bigint",
                "boolean",
                "cmdKeyValue",
                "cmdValue",
                "dependency",
                "env",
                "file",
                "integer",
                "interpolation",
                "meta",
                "null",
                "number",
                "object",
                "string",
                "undefined"
            ],
            "title": "IEduFcInterfaceType",
            "type": "string"
        },
        "Interface": {
            "additionalProperties": false,
            "description": "Schema for an interface of a workflow or function.",
            "properties": {
                "inputs": {
                    "additionalProperties": false,
                    "properties": {
                        "properties": {
                            "additionalProperties": {
                                "$ref": "#/definitions/InterfaceProperty"
                            },
                            "title": "properties",
                            "type": "object"
                        },
                        "required": {
                            "items": {
                                "type": "string"
                            },
                            "title": "required",
                            "type": "array"
                        },
                        "type": {
                            "const": "object",
                            "title": "type",
                            "type": "string"
                        }
                    },
                    "title": "inputs",
                    "type": "object"
                },
                "outputs": {
                    "additionalProperties": false,
                    "properties": {
                        "properties": {
                            "additionalProperties": {
                                "$ref": "#/definitions/InterfaceProperty"
                            },
                            "title": "properties",
                            "type": "object"
                        },
                        "required": {
                            "items": {
                                "type": "string"
                            },
                            "title": "required",
                            "type": "array"
                        },
                        "type": {
                            "const": "object",
                            "title": "type",
                            "type": "string"
                        }
                    },
                    "title": "outputs",
                    "type": "object"
                }
            },
            "title": "Interface",
            "type": "object"
        },
        "InterfaceProperty": {
            "additionalProperties": false,
            "description": "Inspired by JSON Schema for easier conversion from and to other tools.",
            "properties": {
                "const": {
                    "$ref": "#/definitions/InterfaceProperty",
                    "description": "Inspired by JSON Schema for easier conversion from and to other tools.",
                    "title": "const"
                },
                "default": {
                    "title": "default"
                },
                "description": {
                    "title": "description",
                    "type": "string"
                },
                "enum": {
                    "items": {
                        "type": [
                            "string",
                            "number",
                            "boolean"
                        ]
                    },
                    "title": "enum",
                    "type": "array"
                },
                "examples": {
                    "items": {
                        "$ref": "#/definitions/InterfaceProperty"
                    },
                    "title": "examples",
                    "type": "array"
                },
                "items": {
                    "$ref": "#/definitions/InterfaceProperty",
                    "description": "Inspired by JSON Schema for easier conversion from and to other tools.",
                    "title": "items"
                },
                "properties": {
                    "additionalProperties": {
                        "$ref": "#/definitions/InterfaceProperty"
                    },
                    "title": "properties",
                    "type": "object"
                },
                "required": {
                    "items": {
                        "type": "string"
                    },
                    "title": "required",
                    "type": "array"
                },
                "title": {
                    "title": "title",
                    "type": "string"
                },
                "type": {
                    "$ref": "#/definitions/IEduFcInterfaceType",
                    "title": "type"
                }
            },
            "required": [
                "type"
            ],
            "title": "InterfaceProperty",
            "type": "object"
        },
        "Registry": {
            "additionalProperties": false,
            "description": "If a registry is used, this is the schema for it. Currently only supported for runtime: \"docker\"",
            "properties": {
                "tag": {
                    "title": "tag",
                    "type": "string"
                },
                "url": {
                    "title": "url",
                    "type": "string"
                }
            },
            "required": [
                "tag",
                "url"
            ],
            "title": "Registry",
            "type": "object"
        },
        "StepDependency": {
            "additionalProperties": false,
            "description": "Schema for an educational function step dependency.",
            "properties": {
                "outputId": {
                    "description": "the name of the output of a step (thereby its function). has to be one of the outputs defined in\nFunctionSchema.interface.outputs of the dependent step mentioned with \"stepId\"",
                    "title": "outputId",
                    "type": "string"
                },
                "outputPath": {
                    "description": "only used when the output is a complex object and the value is inside. is a string with dot notation\nto point to the value. e.g. \"data.name\" to point to the value of the key \"name\" inside the object\n\"data\".",
                    "items": {
                        "type": "string"
                    },
                    "title": "outputPath",
                    "type": "array"
                },
                "stepId": {
                    "description": "the step which to depend on. Needs to be one defined in the \"steps\" attribute of the workflow\ndefinition. Can be \"inputs\" to refer to the global inputs of the workflow. Can be \"each\" if the\nattribute \"foreach\" in the parent step is defined.",
                    "title": "stepId",
                    "type": "string"
                },
                "value": {
                    "description": "If you want to pass in a value directly instead of a step dependency, you can use this attribute.\nYou can also use interpolation here.",
                    "title": "value",
                    "type": "string"
                }
            },
            "title": "StepDependency",
            "type": "object"
        },
        "StepDependencyNested": {
            "anyOf": [
                {
                    "pattern": "^.*..*..*$",
                    "type": "string"
                },
                {
                    "$ref": "#/definitions/StepDependency"
                },
                {
                    "additionalProperties": {
                        "$ref": "#/definitions/StepDependencyNested"
                    },
                    "type": "object"
                },
                {
                    "items": {
                        "$ref": "#/definitions/StepDependencyNested"
                    },
                    "type": "array"
                }
            ],
            "title": "StepDependencyNested"
        }
    },
    "description": "Represents the configuration schema for a function.",
    "properties": {
        "apiRevision": {
            "const": "edurata.io/function/v1",
            "description": "Refers to the version of this schema and should be updated whenever the schema changes",
            "title": "apiRevision",
            "type": "string"
        },
        "code": {
            "description": "Inline code. You don't need to put the handler function and can write the content of the function directly",
            "title": "code",
            "type": "string"
        },
        "description": {
            "description": "An additional description of the workflow or function",
            "title": "description",
            "type": "string"
        },
        "entrypoint": {
            "description": "Points to the entrypoint of the function. Defaults to index.js, index.py, index.sh, etc.",
            "title": "entrypoint",
            "type": "string"
        },
        "exclude": {
            "description": "Specifies which files to exclude from the function. Can be a glob pattern. Defaults to none.",
            "items": {
                "type": "string"
            },
            "title": "exclude",
            "type": "array"
        },
        "include": {
            "description": "Specifies which files to include in the function. Can be a glob pattern. Defaults to all files in the same directory as the entrypoint.",
            "items": {
                "type": "string"
            },
            "title": "include",
            "type": "array"
        },
        "inputs": {
            "additionalProperties": {
                "$ref": "#/definitions/StepDependencyNested"
            },
            "description": "The global inputs of the workflow (or function). These can be used in any step of the workflow. Here fixed values or secrets or variables can be accessed.",
            "title": "inputs",
            "type": "object"
        },
        "interface": {
            "$ref": "#/definitions/Interface",
            "description": "The schema of inputs and outputs of this workflow or function",
            "title": "interface"
        },
        "name": {
            "description": "An identifier that is unique in the registry. It is used as reference in deployments or workflows.",
            "title": "name",
            "type": "string"
        },
        "outputs": {
            "additionalProperties": {
                "$ref": "#/definitions/StepDependencyNested"
            },
            "description": "Outputs of the workflow or function that can be used as inputs in other workflows or functions or just to inspect the output.",
            "title": "outputs",
            "type": "object"
        },
        "registry": {
            "$ref": "#/definitions/Registry",
            "description": "If the source shouldn't be built but is already in an external registry, you can point to it here.",
            "title": "registry"
        },
        "runtime": {
            "description": "Specifies the programming language the code is written in.",
            "enum": [
                "docker",
                "nodejs20",
                "python3_10"
            ],
            "title": "runtime",
            "type": "string"
        },
        "title": {
            "description": "A short title that describes the workflow or function. This is NOT the id that will be used in the registry!",
            "title": "title",
            "type": "string"
        }
    },
    "type": "object"
}

