{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://rehearse.kurvball.ca/schema/v1/error.schema.json",
  "title": "Rehearse v1: a refusal",
  "description": "What any command prints with --json when it can't do what it was asked. It exits 2 for a usage error and 1 otherwise.",
  "type": "object",
  "required": ["v", "ok", "error"],
  "properties": {
    "v": { "$ref": "common.schema.json#/$defs/v" },
    "ok": { "const": false },
    "error": {
      "type": "object",
      "required": ["code", "says"],
      "properties": {
        "code": {
          "description": "A stable word for the kind of refusal, such as usage, no_manifest, manifest, no_scenario, service, git.",
          "type": "string",
          "pattern": "^[a-z][a-z_]*$"
        },
        "says": { "description": "What went wrong and what to do, in plain words.", "type": "string" },
        "file": { "type": "string" },
        "line": { "type": "integer", "minimum": 1 }
      }
    }
  }
}
