{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "junctionprocedure.json",
    "title": "junctionProcedure",
    "type": "object",
    "description": "Junction addition. Adds input variables into the output.",
    "allOf": [
        {
            "$ref": "procedure.json"
        }
    ],
    "properties": {
        "type": {
            "type": "string",
            "enum": [
                "Junction",
                "JunctionProcedure",
                "Difference",
                "DifferenceProcedure"
            ]
        },
        "extra_pars": {
            "type": "object",
            "properties": {
                "truncate_negative": {
                    "type": "boolean",
                    "description": "Option to replace negative values with zero"
                }
            }
        },
        "boundaries": {
            "oneOf": [
                {
                    "type": "array",
                    "items": {
                        "allOf": [
                            { "$ref": "procedureboundary.json"},
                            {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "pattern": "^input_[0-9]+$"
                                    }
                                }
                            }
                        ]
                    },
                    "minItems": 2
                },
                {
                    "type": "array",
                    "description": "list of lists of observations",
                    "items": {
                        "$ref": "observationlist.json"
                    },
                    "minItems": 2
                },
                {
                    "type": "string",
                    "description": "Path to CSV file. First column must be the datetime index. Headers (first row) must indicate output names"
                }
            ]
        },
        "outputs": {
            "oneOf": [
                {
                    "type": "array",
                    "items": {
                        "allOf": [
                            { "$ref": "procedureboundary.json"},
                            {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "enum": ["output"]
                                    }
                                }
                            }
                        ]
                    },
                    "minItems": 1,
                    "maxItems": 1
                },
                {
                    "type": "array",
                    "description": "list of lists of observations",
                    "items": {
                        "$ref": "observationlist.json"
                    },
                    "minItems": 1,
                    "maxItems": 1
                },
                {
                    "type": "string",
                    "description": "Path to CSV file. First column must be the datetime index. Headers (first row) must indicate output names"
                }
            ]
        }
    },
    "required": [
        "type"
    ]
}