{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "bundle://meta/common.defs.json",
  "title": "casefile common definitions (pure schema; pattern library is meta/pattern-library.json)",
  "definitions": {
    "canonicalDecimal": {
      "type": "string",
      "pattern": "^(0|-?(0\\.[0-9]*[1-9]|[1-9][0-9]*(\\.[0-9]*[1-9])?))$",
      "maxLength": 320
    },
    "sha256Hex": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$",
      "maxLength": 64
    },
    "jsonPointer": {
      "type": "string",
      "pattern": "^(?:/(?:[^~/]|~0|~1)*)*$",
      "maxLength": 2048
    },
    "bundlePath": {
      "type": "string",
      "pattern": "^bundle://[A-Za-z0-9_./-]+$",
      "maxLength": 512
    },
    "isoTimestamp": {
      "type": "string",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$",
      "maxLength": 20
    },
    "artifactRef": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "artifact_id",
        "expected_sha256",
        "relative_path"
      ],
      "properties": {
        "artifact_id": {
          "$ref": "#/definitions/sha256Hex"
        },
        "expected_sha256": {
          "$ref": "#/definitions/sha256Hex"
        },
        "relative_path": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        }
      }
    },
    "checkResult": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "gate",
        "status"
      ],
      "properties": {
        "gate": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64
        },
        "status": {
          "enum": [
            "PASS",
            "FAIL",
            "SKIP"
          ]
        },
        "detail": {
          "type": "string",
          "maxLength": 2048
        }
      }
    }
  }
}
