{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://rehearse.kurvball.ca/schema/v1/list.schema.json",
  "title": "Rehearse v1: rehearse list --json",
  "description": "The scenarios a repository holds, or, with --affected, those a change reaches and why.",
  "type": "object",
  "required": ["v", "by", "scenarios", "refused"],
  "properties": {
    "v": {
      "$ref": "common.schema.json#/$defs/v"
    },
    "by": {
      "description": "all: every scenario. graph: an import graph (Ashlar's, or the manifest's affected.graph) with the covering rule. packages: the touched packages and the packages that depend on them. More may come.",
      "type": "string",
      "examples": ["all", "graph", "packages"]
    },
    "files": {
      "description": "The files the change touched, with --affected.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "said": {
      "description": "Anything the reader should know, such as why Ashlar wasn't used.",
      "type": ["string", "null"]
    },
    "scenarios": {
      "type": "array",
      "items": {
        "allOf": [
          {
            "$ref": "common.schema.json#/$defs/scenarioRef"
          },
          {
            "type": "object",
            "properties": {
              "world": {
                "type": ["string", "null"]
              },
              "person": {
                "$ref": "common.schema.json#/$defs/person"
              },
              "service": {
                "type": ["string", "null"]
              },
              "reachedBy": {
                "description": "With --affected: why the change reaches it, one line per reason.",
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        ]
      }
    },
    "refused": {
      "type": "array",
      "items": {
        "$ref": "common.schema.json#/$defs/refused"
      }
    },
    "graph": {
      "description": "With by graph: the command that gave the graph.",
      "type": ["string", "null"]
    }
  }
}
