{
  "$defs": {
    "DockerOrSingularityImage": {
      "additionalProperties": false,
      "description": "A docker or singularity image.",
      "properties": {
        "working-directory": {
          "anyOf": [
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Location from which the task must be launched inside the container.",
          "title": "Working-Directory"
        },
        "container-hash": {
          "anyOf": [
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Hash for the given container.",
          "title": "Container-Hash"
        },
        "type": {
          "description": "Container runtime.",
          "enum": [
            "docker",
            "singularity"
          ],
          "title": "Type",
          "type": "string"
        },
        "image": {
          "description": "Image name. Example: ``bids/mriqc``.",
          "minLength": 1,
          "title": "Image",
          "type": "string"
        },
        "entrypoint": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "True if the container defines an entrypoint.",
          "title": "Entrypoint"
        },
        "index": {
          "anyOf": [
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Index where the image is available. Example: ``docker.io``.",
          "title": "Index"
        },
        "container-opts": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Container-level arguments. Example: ``--privileged``.",
          "title": "Container-Opts"
        }
      },
      "required": [
        "type",
        "image"
      ],
      "title": "DockerOrSingularityImage",
      "type": "object"
    },
    "EnvironmentVariable": {
      "additionalProperties": false,
      "description": "A name/value pair set in the execution environment.",
      "properties": {
        "name": {
          "description": "Environment variable name.",
          "minLength": 1,
          "pattern": "^[a-zA-Z][0-9_a-zA-Z]*$",
          "title": "Name",
          "type": "string"
        },
        "value": {
          "description": "Value of the environment variable.",
          "title": "Value",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Description of the environment variable.",
          "title": "Description"
        }
      },
      "required": [
        "name",
        "value"
      ],
      "title": "EnvironmentVariable",
      "type": "object"
    },
    "ErrorCode": {
      "additionalProperties": false,
      "description": "An exit code value and its meaning.",
      "properties": {
        "code": {
          "description": "Value of the exit code.",
          "title": "Code",
          "type": "integer"
        },
        "description": {
          "description": "Description of the error code.",
          "title": "Description",
          "type": "string"
        }
      },
      "required": [
        "code",
        "description"
      ],
      "title": "ErrorCode",
      "type": "object"
    },
    "FileInput": {
      "additionalProperties": false,
      "description": "v0.5+styx FileInput \u2014 adds Styx-spec ``mutable`` and ``resolve-parent``.",
      "properties": {
        "list": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "True if the input is a list of values.",
          "title": "List"
        },
        "list-separator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Separator between list items. Defaults to a single space.",
          "title": "List-Separator"
        },
        "min-list-entries": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Minimum number of list entries.",
          "title": "Min-List-Entries"
        },
        "max-list-entries": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Maximum number of list entries.",
          "title": "Max-List-Entries"
        },
        "id": {
          "description": "Input identifier.",
          "minLength": 1,
          "pattern": "^[0-9_a-zA-Z]+$",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "description": "Human-readable name.",
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Input description.",
          "title": "Description"
        },
        "value-key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Token in command-line substituted at runtime.",
          "title": "Value-Key"
        },
        "optional": {
          "default": false,
          "description": "True if optional.",
          "title": "Optional",
          "type": "boolean"
        },
        "requires-inputs": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "IDs of inputs or groups that must be active for this input to be available.",
          "title": "Requires-Inputs"
        },
        "disables-inputs": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "IDs of inputs that are disabled when this input is active.",
          "title": "Disables-Inputs"
        },
        "value-requires": {
          "anyOf": [
            {
              "additionalProperties": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Per-choice IDs of inputs required when that value is selected.",
          "title": "Value-Requires"
        },
        "value-disables": {
          "anyOf": [
            {
              "additionalProperties": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Per-choice IDs of inputs disabled when that value is selected.",
          "title": "Value-Disables"
        },
        "command-line-flag": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Option flag preceding the value at substitution time.",
          "title": "Command-Line-Flag"
        },
        "command-line-flag-separator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Separator between flag and value. Defaults to a single space.",
          "title": "Command-Line-Flag-Separator"
        },
        "type": {
          "const": "File",
          "title": "Type",
          "type": "string"
        },
        "default-value": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Default-Value"
        },
        "uses-absolute-path": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Value must be given as an absolute path.",
          "title": "Uses-Absolute-Path"
        },
        "mutable": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The tool may modify the input file in place.",
          "title": "Mutable"
        },
        "resolve-parent": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "The full parent directory of this file must be visible to the tool.",
          "title": "Resolve-Parent"
        }
      },
      "required": [
        "id",
        "name",
        "type"
      ],
      "title": "FileInput",
      "type": "object"
    },
    "FlagInput": {
      "additionalProperties": false,
      "description": "Boolean flag input. Always carries a command-line flag.",
      "properties": {
        "id": {
          "description": "Input identifier.",
          "minLength": 1,
          "pattern": "^[0-9_a-zA-Z]+$",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "description": "Human-readable name.",
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Input description.",
          "title": "Description"
        },
        "value-key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Token in command-line substituted at runtime.",
          "title": "Value-Key"
        },
        "optional": {
          "default": false,
          "description": "True if optional.",
          "title": "Optional",
          "type": "boolean"
        },
        "requires-inputs": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "IDs of inputs or groups that must be active for this input to be available.",
          "title": "Requires-Inputs"
        },
        "disables-inputs": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "IDs of inputs that are disabled when this input is active.",
          "title": "Disables-Inputs"
        },
        "value-requires": {
          "anyOf": [
            {
              "additionalProperties": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Per-choice IDs of inputs required when that value is selected.",
          "title": "Value-Requires"
        },
        "value-disables": {
          "anyOf": [
            {
              "additionalProperties": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Per-choice IDs of inputs disabled when that value is selected.",
          "title": "Value-Disables"
        },
        "command-line-flag": {
          "description": "Option flag emitted when the flag is set.",
          "title": "Command-Line-Flag",
          "type": "string"
        },
        "command-line-flag-separator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Separator between flag and value. Defaults to a single space.",
          "title": "Command-Line-Flag-Separator"
        },
        "type": {
          "const": "Flag",
          "title": "Type",
          "type": "string"
        },
        "default-value": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Default-Value"
        }
      },
      "required": [
        "id",
        "name",
        "command-line-flag",
        "type"
      ],
      "title": "FlagInput",
      "type": "object"
    },
    "Group": {
      "additionalProperties": false,
      "description": "An input group with optional mutual-exclusion / one-required / all-or-none rules.",
      "properties": {
        "id": {
          "description": "Group identifier.",
          "minLength": 1,
          "pattern": "^[0-9_a-zA-Z]+$",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "description": "Human-readable name for the input group.",
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Description of the input group.",
          "title": "Description"
        },
        "members": {
          "description": "IDs of the inputs belonging to this group.",
          "items": {
            "minLength": 1,
            "pattern": "^[0-9_a-zA-Z]+$",
            "type": "string"
          },
          "minItems": 1,
          "title": "Members",
          "type": "array"
        },
        "mutually-exclusive": {
          "default": false,
          "description": "Only one input in the group may be active at runtime.",
          "title": "Mutually-Exclusive",
          "type": "boolean"
        },
        "one-is-required": {
          "default": false,
          "description": "At least one input in the group must be active at runtime.",
          "title": "One-Is-Required",
          "type": "boolean"
        },
        "all-or-none": {
          "default": false,
          "description": "Members of the group must be toggled together.",
          "title": "All-Or-None",
          "type": "boolean"
        }
      },
      "required": [
        "id",
        "name",
        "members"
      ],
      "title": "Group",
      "type": "object"
    },
    "NumberInput": {
      "additionalProperties": false,
      "description": "Number-typed input (integer or float, controlled by ``integer``).",
      "properties": {
        "list": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "True if the input is a list of values.",
          "title": "List"
        },
        "list-separator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Separator between list items. Defaults to a single space.",
          "title": "List-Separator"
        },
        "min-list-entries": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Minimum number of list entries.",
          "title": "Min-List-Entries"
        },
        "max-list-entries": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Maximum number of list entries.",
          "title": "Max-List-Entries"
        },
        "id": {
          "description": "Input identifier.",
          "minLength": 1,
          "pattern": "^[0-9_a-zA-Z]+$",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "description": "Human-readable name.",
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Input description.",
          "title": "Description"
        },
        "value-key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Token in command-line substituted at runtime.",
          "title": "Value-Key"
        },
        "optional": {
          "default": false,
          "description": "True if optional.",
          "title": "Optional",
          "type": "boolean"
        },
        "requires-inputs": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "IDs of inputs or groups that must be active for this input to be available.",
          "title": "Requires-Inputs"
        },
        "disables-inputs": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "IDs of inputs that are disabled when this input is active.",
          "title": "Disables-Inputs"
        },
        "value-requires": {
          "anyOf": [
            {
              "additionalProperties": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Per-choice IDs of inputs required when that value is selected.",
          "title": "Value-Requires"
        },
        "value-disables": {
          "anyOf": [
            {
              "additionalProperties": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Per-choice IDs of inputs disabled when that value is selected.",
          "title": "Value-Disables"
        },
        "command-line-flag": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Option flag preceding the value at substitution time.",
          "title": "Command-Line-Flag"
        },
        "command-line-flag-separator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Separator between flag and value. Defaults to a single space.",
          "title": "Command-Line-Flag-Separator"
        },
        "type": {
          "const": "Number",
          "title": "Type",
          "type": "string"
        },
        "integer": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "True if the value must be an integer.",
          "title": "Integer"
        },
        "minimum": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Inclusive minimum.",
          "title": "Minimum"
        },
        "maximum": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Inclusive maximum.",
          "title": "Maximum"
        },
        "exclusive-minimum": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Exclusive-Minimum"
        },
        "exclusive-maximum": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Exclusive-Maximum"
        },
        "default-value": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Default-Value"
        },
        "value-choices": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Value-Choices"
        }
      },
      "required": [
        "id",
        "name",
        "type"
      ],
      "title": "NumberInput",
      "type": "object"
    },
    "Output": {
      "additionalProperties": false,
      "description": "A declared output file.\n\nExactly one of ``path-template`` or ``conditional-path-template`` must\nbe set, per the v0.5 spec.",
      "properties": {
        "id": {
          "description": "Output identifier.",
          "minLength": 1,
          "pattern": "^[0-9_a-zA-Z]+$",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "description": "Human-readable output name.",
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Output description.",
          "title": "Description"
        },
        "optional": {
          "default": false,
          "description": "True if the output may not be produced.",
          "title": "Optional",
          "type": "boolean"
        },
        "path-template": {
          "anyOf": [
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Output path relative to the execution directory; may contain value keys.",
          "title": "Path-Template"
        },
        "conditional-path-template": {
          "anyOf": [
            {
              "items": {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "List of single-entry objects mapping a boolean expression to an output path. The first matching expression wins; ``default`` is the fallback.",
          "title": "Conditional-Path-Template"
        },
        "path-template-stripped-extensions": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Extensions stripped from input values before substituting into the template.",
          "title": "Path-Template-Stripped-Extensions"
        },
        "list": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "True if the output is a list of values.",
          "title": "List"
        },
        "command-line-flag": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Option flag preceding the output value at substitution time.",
          "title": "Command-Line-Flag"
        },
        "command-line-flag-separator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Command-Line-Flag-Separator"
        },
        "value-key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Value-Key"
        },
        "uses-absolute-path": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Output filepath will be given as an absolute path.",
          "title": "Uses-Absolute-Path"
        },
        "file-template": {
          "anyOf": [
            {
              "items": {
                "minLength": 1,
                "type": "string"
              },
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Lines (with value keys) written to a generated configuration file.",
          "title": "File-Template"
        }
      },
      "required": [
        "id",
        "name"
      ],
      "title": "Output",
      "type": "object"
    },
    "RootfsImage": {
      "additionalProperties": false,
      "description": "A rootfs container image.",
      "properties": {
        "working-directory": {
          "anyOf": [
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Location from which the task must be launched inside the container.",
          "title": "Working-Directory"
        },
        "container-hash": {
          "anyOf": [
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Hash for the given container.",
          "title": "Container-Hash"
        },
        "type": {
          "const": "rootfs",
          "description": "Container runtime.",
          "title": "Type",
          "type": "string"
        },
        "url": {
          "description": "URL where the image is available.",
          "pattern": "^https?://",
          "title": "Url",
          "type": "string"
        }
      },
      "required": [
        "type",
        "url"
      ],
      "title": "RootfsImage",
      "type": "object"
    },
    "StderrOutput": {
      "additionalProperties": false,
      "description": "Declare the tool's stderr as a named output.",
      "properties": {
        "id": {
          "description": "Output identifier.",
          "minLength": 1,
          "pattern": "^[0-9_a-zA-Z]+$",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Human-readable name.",
          "title": "Name"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Output description.",
          "title": "Description"
        }
      },
      "required": [
        "id"
      ],
      "title": "StderrOutput",
      "type": "object"
    },
    "StdoutOutput": {
      "additionalProperties": false,
      "description": "Declare the tool's stdout as a named output.",
      "properties": {
        "id": {
          "description": "Output identifier.",
          "minLength": 1,
          "pattern": "^[0-9_a-zA-Z]+$",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Human-readable name.",
          "title": "Name"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Output description.",
          "title": "Description"
        }
      },
      "required": [
        "id"
      ],
      "title": "StdoutOutput",
      "type": "object"
    },
    "StringInput": {
      "additionalProperties": false,
      "description": "String-typed input.",
      "properties": {
        "list": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "True if the input is a list of values.",
          "title": "List"
        },
        "list-separator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Separator between list items. Defaults to a single space.",
          "title": "List-Separator"
        },
        "min-list-entries": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Minimum number of list entries.",
          "title": "Min-List-Entries"
        },
        "max-list-entries": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Maximum number of list entries.",
          "title": "Max-List-Entries"
        },
        "id": {
          "description": "Input identifier.",
          "minLength": 1,
          "pattern": "^[0-9_a-zA-Z]+$",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "description": "Human-readable name.",
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Input description.",
          "title": "Description"
        },
        "value-key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Token in command-line substituted at runtime.",
          "title": "Value-Key"
        },
        "optional": {
          "default": false,
          "description": "True if optional.",
          "title": "Optional",
          "type": "boolean"
        },
        "requires-inputs": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "IDs of inputs or groups that must be active for this input to be available.",
          "title": "Requires-Inputs"
        },
        "disables-inputs": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "IDs of inputs that are disabled when this input is active.",
          "title": "Disables-Inputs"
        },
        "value-requires": {
          "anyOf": [
            {
              "additionalProperties": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Per-choice IDs of inputs required when that value is selected.",
          "title": "Value-Requires"
        },
        "value-disables": {
          "anyOf": [
            {
              "additionalProperties": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Per-choice IDs of inputs disabled when that value is selected.",
          "title": "Value-Disables"
        },
        "command-line-flag": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Option flag preceding the value at substitution time.",
          "title": "Command-Line-Flag"
        },
        "command-line-flag-separator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Separator between flag and value. Defaults to a single space.",
          "title": "Command-Line-Flag-Separator"
        },
        "type": {
          "const": "String",
          "title": "Type",
          "type": "string"
        },
        "default-value": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Default-Value"
        },
        "value-choices": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Value-Choices"
        }
      },
      "required": [
        "id",
        "name",
        "type"
      ],
      "title": "StringInput",
      "type": "object"
    },
    "SubCommandInput": {
      "additionalProperties": false,
      "description": "An input whose ``type`` is a single nested ``SubCommandType``.",
      "properties": {
        "list": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "True if the input is a list of values.",
          "title": "List"
        },
        "list-separator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Separator between list items. Defaults to a single space.",
          "title": "List-Separator"
        },
        "min-list-entries": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Minimum number of list entries.",
          "title": "Min-List-Entries"
        },
        "max-list-entries": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Maximum number of list entries.",
          "title": "Max-List-Entries"
        },
        "id": {
          "description": "Input identifier.",
          "minLength": 1,
          "pattern": "^[0-9_a-zA-Z]+$",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "description": "Human-readable name.",
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Input description.",
          "title": "Description"
        },
        "value-key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Token in command-line substituted at runtime.",
          "title": "Value-Key"
        },
        "optional": {
          "default": false,
          "description": "True if optional.",
          "title": "Optional",
          "type": "boolean"
        },
        "requires-inputs": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "IDs of inputs or groups that must be active for this input to be available.",
          "title": "Requires-Inputs"
        },
        "disables-inputs": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "IDs of inputs that are disabled when this input is active.",
          "title": "Disables-Inputs"
        },
        "value-requires": {
          "anyOf": [
            {
              "additionalProperties": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Per-choice IDs of inputs required when that value is selected.",
          "title": "Value-Requires"
        },
        "value-disables": {
          "anyOf": [
            {
              "additionalProperties": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Per-choice IDs of inputs disabled when that value is selected.",
          "title": "Value-Disables"
        },
        "command-line-flag": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Option flag preceding the value at substitution time.",
          "title": "Command-Line-Flag"
        },
        "command-line-flag-separator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Separator between flag and value. Defaults to a single space.",
          "title": "Command-Line-Flag-Separator"
        },
        "type": {
          "$ref": "#/$defs/SubCommandType"
        }
      },
      "required": [
        "id",
        "name",
        "type"
      ],
      "title": "SubCommandInput",
      "type": "object"
    },
    "SubCommandType": {
      "additionalProperties": false,
      "description": "A nested command-line with its own inputs and outputs.",
      "properties": {
        "id": {
          "description": "Sub-command identifier.",
          "minLength": 1,
          "pattern": "^[0-9_a-zA-Z]+$",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Human-readable name.",
          "title": "Name"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Sub-command description.",
          "title": "Description"
        },
        "command-line": {
          "description": "Command-line template for this sub-command.",
          "minLength": 1,
          "title": "Command-Line",
          "type": "string"
        },
        "inputs": {
          "anyOf": [
            {
              "items": {
                "anyOf": [
                  {
                    "$ref": "#/$defs/StringInput"
                  },
                  {
                    "$ref": "#/$defs/FileInput"
                  },
                  {
                    "$ref": "#/$defs/NumberInput"
                  },
                  {
                    "$ref": "#/$defs/FlagInput"
                  },
                  {
                    "$ref": "#/$defs/SubCommandInput"
                  },
                  {
                    "$ref": "#/$defs/SubCommandUnionInput"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Inputs available within this sub-command.",
          "title": "Inputs"
        },
        "output-files": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/Output"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Outputs produced by this sub-command.",
          "title": "Output-Files"
        }
      },
      "required": [
        "id",
        "command-line"
      ],
      "title": "SubCommandType",
      "type": "object"
    },
    "SubCommandUnionInput": {
      "additionalProperties": false,
      "description": "An input whose ``type`` is a list of ``SubCommandType`` alternatives.",
      "properties": {
        "list": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "True if the input is a list of values.",
          "title": "List"
        },
        "list-separator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Separator between list items. Defaults to a single space.",
          "title": "List-Separator"
        },
        "min-list-entries": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Minimum number of list entries.",
          "title": "Min-List-Entries"
        },
        "max-list-entries": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Maximum number of list entries.",
          "title": "Max-List-Entries"
        },
        "id": {
          "description": "Input identifier.",
          "minLength": 1,
          "pattern": "^[0-9_a-zA-Z]+$",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "description": "Human-readable name.",
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Input description.",
          "title": "Description"
        },
        "value-key": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Token in command-line substituted at runtime.",
          "title": "Value-Key"
        },
        "optional": {
          "default": false,
          "description": "True if optional.",
          "title": "Optional",
          "type": "boolean"
        },
        "requires-inputs": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "IDs of inputs or groups that must be active for this input to be available.",
          "title": "Requires-Inputs"
        },
        "disables-inputs": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "IDs of inputs that are disabled when this input is active.",
          "title": "Disables-Inputs"
        },
        "value-requires": {
          "anyOf": [
            {
              "additionalProperties": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Per-choice IDs of inputs required when that value is selected.",
          "title": "Value-Requires"
        },
        "value-disables": {
          "anyOf": [
            {
              "additionalProperties": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Per-choice IDs of inputs disabled when that value is selected.",
          "title": "Value-Disables"
        },
        "command-line-flag": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Option flag preceding the value at substitution time.",
          "title": "Command-Line-Flag"
        },
        "command-line-flag-separator": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Separator between flag and value. Defaults to a single space.",
          "title": "Command-Line-Flag-Separator"
        },
        "type": {
          "items": {
            "$ref": "#/$defs/SubCommandType"
          },
          "minItems": 1,
          "title": "Type",
          "type": "array"
        }
      },
      "required": [
        "id",
        "name",
        "type"
      ],
      "title": "SubCommandUnionInput",
      "type": "object"
    },
    "SuggestedResources": {
      "additionalProperties": false,
      "description": "Hints about computational resources needed to run the tool.",
      "properties": {
        "cpu-cores": {
          "anyOf": [
            {
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Requested number of CPU cores.",
          "title": "Cpu-Cores"
        },
        "ram": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Requested GB of RAM.",
          "title": "Ram"
        },
        "disk-space": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Requested GB of storage.",
          "title": "Disk-Space"
        },
        "nodes": {
          "anyOf": [
            {
              "minimum": 1,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Requested number of nodes to spread the application across.",
          "title": "Nodes"
        },
        "walltime-estimate": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Estimated wall time of a task in seconds.",
          "title": "Walltime-Estimate"
        }
      },
      "title": "SuggestedResources",
      "type": "object"
    },
    "TestAssertions": {
      "additionalProperties": false,
      "description": "Assertions about a tool run.\n\nAt least one of ``exit-code`` or ``output-files`` must be provided.",
      "properties": {
        "exit-code": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Expected exit code.",
          "title": "Exit-Code"
        },
        "output-files": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/_OutputAssertion"
              },
              "minItems": 1,
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Output-Files"
        }
      },
      "title": "TestAssertions",
      "type": "object"
    },
    "TestCase": {
      "additionalProperties": false,
      "description": "A named test case bound to a sample invocation.",
      "properties": {
        "name": {
          "description": "Test case name.",
          "minLength": 1,
          "title": "Name",
          "type": "string"
        },
        "invocation": {
          "additionalProperties": true,
          "description": "Sample invocation used by the test.",
          "title": "Invocation",
          "type": "object"
        },
        "assertions": {
          "$ref": "#/$defs/TestAssertions",
          "description": "Assertions to evaluate after the run."
        }
      },
      "required": [
        "name",
        "invocation",
        "assertions"
      ],
      "title": "TestCase",
      "type": "object"
    },
    "_OutputAssertion": {
      "additionalProperties": false,
      "properties": {
        "id": {
          "description": "ID referring to an output-file.",
          "minLength": 1,
          "pattern": "^[0-9_a-zA-Z]+$",
          "title": "Id",
          "type": "string"
        },
        "md5-reference": {
          "anyOf": [
            {
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "MD5 checksum to match against the produced output.",
          "title": "Md5-Reference"
        }
      },
      "required": [
        "id"
      ],
      "title": "_OutputAssertion",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "description": "A complete Boutiques 0.5+styx descriptor.\n\nField-compatible with v0.5 except for the ``schema-version`` literal\nand the broader ``inputs`` union (which admits SubCommand variants).",
  "properties": {
    "name": {
      "description": "Tool name.",
      "minLength": 1,
      "title": "Name",
      "type": "string"
    },
    "description": {
      "description": "Tool description.",
      "minLength": 1,
      "title": "Description",
      "type": "string"
    },
    "command-line": {
      "description": "Command-line template.",
      "minLength": 1,
      "title": "Command-Line",
      "type": "string"
    },
    "schema-version": {
      "const": "0.5+styx",
      "title": "Schema-Version",
      "type": "string"
    },
    "inputs": {
      "items": {
        "anyOf": [
          {
            "$ref": "#/$defs/StringInput"
          },
          {
            "$ref": "#/$defs/FileInput"
          },
          {
            "$ref": "#/$defs/NumberInput"
          },
          {
            "$ref": "#/$defs/FlagInput"
          },
          {
            "$ref": "#/$defs/SubCommandInput"
          },
          {
            "$ref": "#/$defs/SubCommandUnionInput"
          }
        ]
      },
      "minItems": 1,
      "title": "Inputs",
      "type": "array"
    },
    "tool-version": {
      "anyOf": [
        {
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Tool version.",
      "title": "Tool-Version"
    },
    "author": {
      "anyOf": [
        {
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Author"
    },
    "url": {
      "anyOf": [
        {
          "pattern": "^https?://",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Url"
    },
    "descriptor-url": {
      "anyOf": [
        {
          "pattern": "^https?://",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Descriptor-Url"
    },
    "doi": {
      "anyOf": [
        {
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Doi"
    },
    "tool-doi": {
      "anyOf": [
        {
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Tool-Doi"
    },
    "deprecated-by-doi": {
      "anyOf": [
        {
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Deprecated-By-Doi"
    },
    "online-platform-urls": {
      "anyOf": [
        {
          "items": {
            "pattern": "^https?://",
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Online-Platform-Urls"
    },
    "shell": {
      "anyOf": [
        {
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Shell"
    },
    "container-image": {
      "anyOf": [
        {
          "discriminator": {
            "mapping": {
              "docker": "#/$defs/DockerOrSingularityImage",
              "rootfs": "#/$defs/RootfsImage",
              "singularity": "#/$defs/DockerOrSingularityImage"
            },
            "propertyName": "type"
          },
          "oneOf": [
            {
              "$ref": "#/$defs/DockerOrSingularityImage"
            },
            {
              "$ref": "#/$defs/RootfsImage"
            }
          ]
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Container-Image"
    },
    "environment-variables": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/EnvironmentVariable"
          },
          "minItems": 1,
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Environment-Variables"
    },
    "groups": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/Group"
          },
          "minItems": 1,
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Groups"
    },
    "output-files": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/Output"
          },
          "minItems": 1,
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Output-Files"
    },
    "stdout-output": {
      "anyOf": [
        {
          "$ref": "#/$defs/StdoutOutput"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "If present, the tool's stdout is captured as this named output."
    },
    "stderr-output": {
      "anyOf": [
        {
          "$ref": "#/$defs/StderrOutput"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "If present, the tool's stderr is captured as this named output."
    },
    "suggested-resources": {
      "anyOf": [
        {
          "$ref": "#/$defs/SuggestedResources"
        },
        {
          "type": "null"
        }
      ],
      "default": null
    },
    "error-codes": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/ErrorCode"
          },
          "minItems": 1,
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error-Codes"
    },
    "tests": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/TestCase"
          },
          "minItems": 1,
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Tests"
    },
    "tags": {
      "anyOf": [
        {
          "additionalProperties": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "boolean"
              }
            ]
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Tags"
    },
    "invocation-schema": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Invocation-Schema"
    },
    "custom": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Custom"
    }
  },
  "required": [
    "name",
    "description",
    "command-line",
    "schema-version",
    "inputs"
  ],
  "title": "Descriptor",
  "type": "object"
}
