{
    "type": "object",
    "properties": {
        "class": {
            "type": "string",
            "enum": [
                "ExpressionTool"
            ]
        },
        "expression": {
            "$ref": "#/definitions/Expression"
        },
        "id": {
            "type": "string"
        },
        "inputs": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/InputParameter"
            }
        },
        "outputs": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/OutputParameter"
            }
        },
        "requirements": {
            "type": "array",
            "items": {
                "anyOf": [
                    {
                        "$ref": "#/definitions/DockerRequirement"
                    },
                    {
                        "$ref": "#/definitions/SubworkflowFeatureRequirement"
                    },
                    {
                        "$ref": "#/definitions/CreateFileRequirement"
                    },
                    {
                        "$ref": "#/definitions/EnvVarRequirement"
                    },
                    {
                        "$ref": "#/definitions/ScatterFeatureRequirement"
                    },
                    {
                        "$ref": "#/definitions/SchemaDefRequirement"
                    },
                    {
                        "$ref": "#/definitions/ExpressionEngineRequirement"
                    }
                ]
            }
        },
        "hints": {
            "type": "array",
            "items": {}
        },
        "label": {
            "type": "string"
        },
        "description": {
            "type": "string"
        },
        "cwlVersion": {
            "$ref": "#/definitions/CWLVersions",
            "description": "CWL document version"
        },
        "sbg:modifiedBy": {
            "type": "string"
        },
        "sbg:revisionInfo": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/SBGRevision"
            }
        },
        "sbg:revision": {
            "type": "number"
        },
        "sbg:createdBy": {
            "type": "string"
        },
        "sbg:id": {
            "type": "string"
        },
        "sbg:contributors": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "sbg:sbgMaintained": {
            "type": "boolean"
        },
        "sbg:project": {
            "type": "string"
        },
        "sbg:validationErrors": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "sbg:modifiedOn": {
            "type": "number"
        },
        "sbg:revisionNotes": {
            "type": "string"
        },
        "sbg:toolkit": {
            "type": "string"
        },
        "sbg:toolkitVersion": {
            "type": "string"
        },
        "sbg:links": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/SBGLink"
            }
        },
        "sbg:toolAuthor": {
            "type": "string"
        },
        "sbg:license": {
            "type": "string"
        },
        "sbg:categories": {
            "type": "array",
            "items": {
                "type": "string"
            }
        }
    },
    "required": [
        "class",
        "expression",
        "inputs",
        "outputs"
    ],
    "definitions": {
        "Expression": {
            "type": "object",
            "properties": {
                "engine": {
                    "type": "string"
                },
                "script": {
                    "type": "string"
                },
                "class": {
                    "type": "string",
                    "enum": [
                        "Expression"
                    ]
                }
            },
            "required": [
                "engine",
                "script",
                "class"
            ]
        },
        "InputParameter": {
            "type": "object",
            "properties": {
                "type": {
                    "anyOf": [
                        {
                            "type": "string",
                            "enum": [
                                "null"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "boolean"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "int"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "long"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "float"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "double"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "bytes"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "string"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "File"
                            ]
                        },
                        {
                            "$ref": "#/definitions/InputSchema"
                        },
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": {
                                "anyOf": [
                                    {
                                        "type": "string",
                                        "enum": [
                                            "null"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "boolean"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "int"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "long"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "float"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "double"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "bytes"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "string"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "File"
                                        ]
                                    },
                                    {
                                        "$ref": "#/definitions/InputSchema"
                                    },
                                    {
                                        "type": "string"
                                    }
                                ]
                            }
                        }
                    ]
                },
                "id": {
                    "type": "string"
                },
                "inputBinding": {
                    "$ref": "#/definitions/Binding"
                },
                "label": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "streamable": {
                    "type": "boolean"
                },
                "default": {},
                "sbg:fileTypes": {
                    "type": "string"
                }
            },
            "required": [
                "id"
            ]
        },
        "InputSchema": {
            "type": "object",
            "properties": {
                "type": {
                    "anyOf": [
                        {
                            "type": "string",
                            "enum": [
                                "record"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "array"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "enum"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "map"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "null"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "boolean"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "int"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "long"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "float"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "double"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "bytes"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "string"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "File"
                            ]
                        },
                        {
                            "$ref": "#/definitions/InputSchema"
                        },
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": {
                                "anyOf": [
                                    {
                                        "type": "string",
                                        "enum": [
                                            "record"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "array"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "enum"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "map"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "null"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "boolean"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "int"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "long"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "float"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "double"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "bytes"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "string"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "File"
                                        ]
                                    },
                                    {
                                        "$ref": "#/definitions/InputSchema"
                                    },
                                    {
                                        "type": "string"
                                    }
                                ]
                            }
                        }
                    ]
                },
                "inputBinding": {
                    "$ref": "#/definitions/Binding"
                },
                "items": {
                    "anyOf": [
                        {
                            "type": "string",
                            "enum": [
                                "null"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "boolean"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "int"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "long"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "float"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "double"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "bytes"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "string"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "File"
                            ]
                        },
                        {
                            "$ref": "#/definitions/InputSchema"
                        },
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": {
                                "anyOf": [
                                    {
                                        "type": "string",
                                        "enum": [
                                            "null"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "boolean"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "int"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "long"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "float"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "double"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "bytes"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "string"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "File"
                                        ]
                                    },
                                    {
                                        "$ref": "#/definitions/InputSchema"
                                    },
                                    {
                                        "type": "string"
                                    }
                                ]
                            }
                        }
                    ]
                },
                "values": {
                    "type": "string"
                },
                "symbols": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "fields": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/InputSchema"
                    }
                }
            },
            "required": [
                "type"
            ]
        },
        "Binding": {
            "type": "object",
            "properties": {
                "loadContents": {
                    "type": "boolean"
                },
                "secondaryFiles": {
                    "anyOf": [
                        {
                            "type": "string"
                        },
                        {
                            "$ref": "#/definitions/Expression"
                        },
                        {
                            "type": "array",
                            "items": {
                                "anyOf": [
                                    {
                                        "type": "string"
                                    },
                                    {
                                        "$ref": "#/definitions/Expression"
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        },
        "OutputParameter": {
            "type": "object",
            "properties": {
                "type": {
                    "anyOf": [
                        {
                            "type": "string",
                            "enum": [
                                "null"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "boolean"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "int"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "long"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "float"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "double"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "bytes"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "string"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "File"
                            ]
                        },
                        {
                            "$ref": "#/definitions/OutputSchema"
                        },
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": {
                                "anyOf": [
                                    {
                                        "type": "string",
                                        "enum": [
                                            "null"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "boolean"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "int"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "long"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "float"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "double"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "bytes"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "string"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "File"
                                        ]
                                    },
                                    {
                                        "$ref": "#/definitions/OutputSchema"
                                    },
                                    {
                                        "type": "string"
                                    }
                                ]
                            }
                        }
                    ]
                },
                "id": {
                    "type": "string"
                },
                "label": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "streamable": {
                    "type": "boolean"
                },
                "default": {},
                "sbg:fileTypes": {
                    "type": "string"
                }
            },
            "required": [
                "id"
            ]
        },
        "OutputSchema": {
            "type": "object",
            "properties": {
                "type": {
                    "anyOf": [
                        {
                            "type": "string",
                            "enum": [
                                "record"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "array"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "enum"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "map"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "null"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "boolean"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "int"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "long"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "float"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "double"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "bytes"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "string"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "File"
                            ]
                        },
                        {
                            "$ref": "#/definitions/OutputSchema"
                        },
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": {
                                "anyOf": [
                                    {
                                        "type": "string",
                                        "enum": [
                                            "record"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "array"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "enum"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "map"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "null"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "boolean"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "int"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "long"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "float"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "double"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "bytes"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "string"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "File"
                                        ]
                                    },
                                    {
                                        "$ref": "#/definitions/OutputSchema"
                                    },
                                    {
                                        "type": "string"
                                    }
                                ]
                            }
                        }
                    ]
                },
                "items": {
                    "anyOf": [
                        {
                            "type": "string",
                            "enum": [
                                "null"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "boolean"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "int"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "long"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "float"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "double"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "bytes"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "string"
                            ]
                        },
                        {
                            "type": "string",
                            "enum": [
                                "File"
                            ]
                        },
                        {
                            "$ref": "#/definitions/OutputSchema"
                        },
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": {
                                "anyOf": [
                                    {
                                        "type": "string",
                                        "enum": [
                                            "null"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "boolean"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "int"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "long"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "float"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "double"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "bytes"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "string"
                                        ]
                                    },
                                    {
                                        "type": "string",
                                        "enum": [
                                            "File"
                                        ]
                                    },
                                    {
                                        "$ref": "#/definitions/OutputSchema"
                                    },
                                    {
                                        "type": "string"
                                    }
                                ]
                            }
                        }
                    ]
                },
                "values": {
                    "type": "string"
                },
                "symbols": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "fields": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/OutputSchema"
                    }
                }
            },
            "required": [
                "type"
            ]
        },
        "DockerRequirement": {
            "type": "object",
            "properties": {
                "class": {
                    "type": "string",
                    "enum": [
                        "DockerRequirement"
                    ]
                },
                "dockerPull": {
                    "type": "string"
                },
                "dockerLoad": {
                    "type": "string"
                },
                "dockerFile": {
                    "type": "string"
                },
                "dockerImageId": {
                    "type": "string"
                },
                "dockerOutputDirectory": {
                    "type": "string"
                }
            },
            "required": [
                "class"
            ]
        },
        "SubworkflowFeatureRequirement": {
            "type": "object",
            "properties": {}
        },
        "CreateFileRequirement": {
            "type": "object",
            "properties": {
                "class": {
                    "type": "string",
                    "enum": [
                        "CreateFileRequirement"
                    ]
                },
                "fileDef": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/FileDef"
                    }
                }
            },
            "required": [
                "class",
                "fileDef"
            ]
        },
        "FileDef": {
            "type": "object",
            "properties": {
                "filename": {
                    "anyOf": [
                        {
                            "type": "string"
                        },
                        {
                            "$ref": "#/definitions/Expression"
                        }
                    ]
                },
                "fileContent": {
                    "anyOf": [
                        {
                            "type": "string"
                        },
                        {
                            "$ref": "#/definitions/Expression"
                        }
                    ]
                }
            },
            "required": [
                "filename",
                "fileContent"
            ]
        },
        "EnvVarRequirement": {
            "type": "object",
            "properties": {}
        },
        "ScatterFeatureRequirement": {
            "type": "object",
            "properties": {}
        },
        "SchemaDefRequirement": {
            "type": "object",
            "properties": {}
        },
        "ExpressionEngineRequirement": {
            "type": "object",
            "properties": {
                "class": {
                    "type": "string",
                    "enum": [
                        "ExpressionEngineRequirement"
                    ]
                },
                "id": {
                    "type": "string"
                },
                "requirements": {
                    "type": "array",
                    "items": {
                        "anyOf": [
                            {
                                "$ref": "#/definitions/DockerRequirement"
                            },
                            {
                                "$ref": "#/definitions/SubworkflowFeatureRequirement"
                            },
                            {
                                "$ref": "#/definitions/CreateFileRequirement"
                            },
                            {
                                "$ref": "#/definitions/EnvVarRequirement"
                            },
                            {
                                "$ref": "#/definitions/ScatterFeatureRequirement"
                            },
                            {
                                "$ref": "#/definitions/SchemaDefRequirement"
                            },
                            {
                                "$ref": "#/definitions/ExpressionEngineRequirement"
                            }
                        ]
                    }
                },
                "engineCommand": {
                    "anyOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    ]
                },
                "engineConfig": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            },
            "required": [
                "class",
                "id"
            ]
        },
        "SBGRevision": {
            "type": "object",
            "properties": {
                "sbg:revision": {
                    "type": "number"
                },
                "sbg:modifiedBy": {
                    "type": "string"
                },
                "sbg:revisionNotes": {
                    "type": "string"
                },
                "sbg:modifiedOn": {
                    "type": "number"
                }
            },
            "required": [
                "sbg:revision",
                "sbg:modifiedBy",
                "sbg:revisionNotes",
                "sbg:modifiedOn"
            ]
        },
        "SBGLink": {
            "type": "object",
            "properties": {
                "label": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                }
            },
            "required": [
                "label",
                "id"
            ]
        },
        "CWLVersions": {
            "type": "string",
            "enum": [
                "sbg:draft-2"
            ]
        }
    },
    "$schema": "http://json-schema.org/draft-04/schema#"
}
