{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://paulkov.github.io/dpone/schemas/gitops/airflow-outcome-gate.schema.json",
  "title": "dpone GitOps Airflow outcome gate contract",
  "type": "object",
  "required": [
    "kind",
    "schema_version",
    "producer",
    "xcom_summary_path",
    "required_status",
    "status",
    "passed"
  ],
  "properties": {
    "kind": {
      "const": "gitops.airflow_outcome_gate"
    },
    "schema_version": {
      "type": "string"
    },
    "producer": {
      "type": "string"
    },
    "xcom_summary_path": {
      "type": "string"
    },
    "required_status": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "passed": {
      "type": "boolean"
    },
    "run_spec_path": {
      "type": "string"
    },
    "runtime_evidence_path": {
      "type": "string"
    },
    "runtime_evidence_sha256": {
      "type": "string"
    },
    "failed_step": {
      "type": [
        "string",
        "null"
      ]
    },
    "step_counts": {
      "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
}
