{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://paulkov.github.io/dpone/schemas/gitops/airflow-runtime-evidence.schema.json",
  "title": "dpone GitOps Airflow runtime evidence contract",
  "type": "object",
  "required": [
    "kind",
    "schema_version",
    "producer",
    "run_spec_path",
    "bundle_path",
    "image",
    "status",
    "started_at",
    "finished_at",
    "duration_seconds",
    "steps"
  ],
  "properties": {
    "kind": {
      "const": "gitops.airflow_runtime_evidence"
    },
    "schema_version": {
      "type": "string"
    },
    "producer": {
      "type": "string"
    },
    "run_spec_path": {
      "type": "string"
    },
    "bundle_path": {
      "type": "string"
    },
    "image": {
      "type": "string"
    },
    "image_digest": {
      "type": [
        "string",
        "null"
      ]
    },
    "status": {
      "type": "string"
    },
    "started_at": {
      "type": "string"
    },
    "finished_at": {
      "type": "string"
    },
    "duration_seconds": {
      "type": "number"
    },
    "steps": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "name",
          "kind",
          "command",
          "required",
          "status",
          "exit_code",
          "started_at",
          "finished_at",
          "duration_seconds"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "command": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          },
          "exit_code": {
            "type": "integer"
          },
          "started_at": {
            "type": "string"
          },
          "finished_at": {
            "type": "string"
          },
          "duration_seconds": {
            "type": "number"
          },
          "manifest": {
            "type": "string"
          }
        }
      }
    },
    "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
}
