{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://paulkov.github.io/dpone/schemas/gitops/catalog-bundle.schema.json",
  "title": "dpone GitOps catalog bundle",
  "type": "object",
  "required": [
    "schema",
    "bundle_id",
    "kind",
    "publisher_id",
    "environment",
    "entrypoint",
    "artifacts"
  ],
  "additionalProperties": false,
  "properties": {
    "schema": {
      "const": "dpone.catalog-bundle.v1"
    },
    "bundle_id": {
      "type": "string",
      "pattern": "^sha256:[0-9a-f]{64}$"
    },
    "kind": {
      "enum": [
        "recipe_catalog",
        "connection_registry"
      ]
    },
    "publisher_id": {
      "type": "string",
      "minLength": 1
    },
    "environment": {
      "type": [
        "string",
        "null"
      ]
    },
    "entrypoint": {
      "type": "string",
      "minLength": 1
    },
    "artifacts": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1001,
      "items": {
        "type": "object",
        "required": [
          "logical_id",
          "path",
          "sha256",
          "size_bytes"
        ],
        "properties": {
          "logical_id": {
            "type": "string",
            "minLength": 1
          },
          "path": {
            "type": "string",
            "minLength": 1
          },
          "sha256": {
            "type": "string",
            "pattern": "^sha256:[0-9a-f]{64}$"
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 4194304
          }
        },
        "additionalProperties": false
      }
    }
  }
}
