{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://paulkov.github.io/dpone/schemas/gitops/verify.schema.json",
  "title": "dpone GitOps verify contract",
  "type": "object",
  "required": [
    "kind",
    "plan",
    "worktree",
    "manifest",
    "checked_paths"
  ],
  "properties": {
    "kind": {
      "const": "gitops.verify"
    },
    "plan": {
      "type": "string"
    },
    "worktree": {
      "type": "string"
    },
    "manifest": {
      "type": "string"
    },
    "checked_paths": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "path",
          "required",
          "exists",
          "is_dir"
        ],
        "properties": {
          "path": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "exists": {
            "type": "boolean"
          },
          "is_dir": {
            "type": "boolean"
          }
        }
      }
    },
    "lock_checks": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "warnings": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/issue"
      }
    },
    "blockers": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/issue"
      }
    }
  },
  "$defs": {
    "issue": {
      "type": "object",
      "additionalProperties": true,
      "required": [
        "code",
        "message",
        "path",
        "source"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "path": {
          "type": "string"
        },
        "source": {
          "type": "string"
        }
      }
    }
  },
  "additionalProperties": true
}
