{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://paulkov.github.io/dpone/schemas/gitops/attestation.schema.json",
  "title": "dpone GitOps bundle attestation contract",
  "type": "object",
  "required": [
    "schema_version",
    "producer",
    "hash_algorithm",
    "bundle_digest",
    "provenance",
    "artifacts"
  ],
  "properties": {
    "schema_version": {
      "type": "string"
    },
    "producer": {
      "type": "string"
    },
    "hash_algorithm": {
      "const": "sha256"
    },
    "bundle_digest": {
      "type": "string"
    },
    "provenance": {
      "type": "object",
      "additionalProperties": true
    },
    "artifacts": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "path",
          "sha256",
          "bytes"
        ],
        "properties": {
          "path": {
            "type": "string"
          },
          "sha256": {
            "type": "string"
          },
          "bytes": {
            "type": "integer"
          }
        }
      }
    }
  },
  "$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
}
