{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://paulkov.github.io/dpone/schemas/gitops/safe-sample-runtime-readiness.schema.json",
  "title": "dpone GitOps safe sample runtime readiness",
  "type": "object",
  "required": [
    "schema",
    "ready",
    "available_contracts",
    "blockers",
    "errors"
  ],
  "additionalProperties": true,
  "properties": {
    "schema": {
      "const": "dpone.safe-sample-runtime-readiness.v1"
    },
    "ready": {
      "type": "boolean"
    },
    "available_contracts": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "uniqueItems": true
    },
    "blockers": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "uniqueItems": true
    },
    "errors": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/error"
      }
    }
  },
  "$defs": {
    "error": {
      "type": "object",
      "required": [
        "schema",
        "code",
        "stage",
        "severity",
        "message"
      ],
      "additionalProperties": true,
      "properties": {
        "schema": {
          "const": "dpone.error.v1"
        },
        "code": {
          "type": "string",
          "pattern": "^DPONE_[A-Z0-9_]+$"
        },
        "stage": {
          "type": "string",
          "minLength": 1
        },
        "severity": {
          "enum": [
            "info",
            "warning",
            "error"
          ]
        },
        "message": {
          "type": "string",
          "minLength": 1
        },
        "fixes": {
          "type": "array"
        }
      }
    }
  }
}
