{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://paulkov.github.io/dpone/schemas/gitops/airflow-k8s-smoke.schema.json",
  "title": "dpone GitOps Airflow K8s smoke contract",
  "type": "object",
  "required": [
    "kind",
    "schema_version",
    "producer",
    "mode",
    "runner_kind",
    "runner_policy",
    "run_spec_path",
    "runtime_profile_path",
    "pod_contract_path",
    "namespace",
    "service_account",
    "image",
    "image_ref",
    "smoke_name",
    "timeout_seconds",
    "checks",
    "commands",
    "results"
  ],
  "properties": {
    "kind": {
      "const": "gitops.airflow_k8s_smoke"
    },
    "schema_version": {
      "type": "string"
    },
    "producer": {
      "type": "string"
    },
    "mode": {
      "type": "string"
    },
    "runner_kind": {
      "type": "string"
    },
    "runner_policy": {
      "type": "string"
    },
    "run_spec_path": {
      "type": "string"
    },
    "runtime_profile_path": {
      "type": "string"
    },
    "pod_contract_path": {
      "type": "string"
    },
    "image_contract_path": {
      "type": "string"
    },
    "xcom_summary_path": {
      "type": "string"
    },
    "namespace": {
      "type": "string"
    },
    "service_account": {
      "type": "string"
    },
    "image": {
      "type": "string"
    },
    "image_digest": {
      "type": [
        "string",
        "null"
      ]
    },
    "image_ref": {
      "type": "string"
    },
    "smoke_name": {
      "type": "string"
    },
    "timeout_seconds": {
      "type": "integer"
    },
    "checks": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "name",
          "passed",
          "severity",
          "message",
          "path",
          "source"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "passed": {
            "type": "boolean"
          },
          "severity": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "source": {
            "type": "string"
          }
        }
      }
    },
    "commands": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "name",
          "kind",
          "command",
          "required",
          "timeout_seconds",
          "executed"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "command": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "timeout_seconds": {
            "type": "integer"
          },
          "executed": {
            "type": "boolean"
          }
        }
      }
    },
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "name",
          "command",
          "exit_code",
          "stdout",
          "stderr",
          "duration_seconds"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "command": {
            "type": "string"
          },
          "exit_code": {
            "type": "integer"
          },
          "stdout": {
            "type": "string"
          },
          "stderr": {
            "type": "string"
          },
          "duration_seconds": {
            "type": "number"
          }
        }
      }
    },
    "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
}
