{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:junexis:schema:registry-offline-snapshot:0.1",
  "title": "Lokalny snapshot Junexis Registry 0.1",
  "type": "object",
  "additionalProperties": false,
  "required": ["schemaVersion", "sourceSnapshot", "cachedArtifacts"],
  "properties": {
    "schemaVersion": { "const": "junexis.registry-offline-snapshot/0.1" },
    "sourceSnapshot": {
      "type": "object",
      "additionalProperties": false,
      "required": ["schemaVersion", "snapshotId"],
      "properties": {
        "schemaVersion": { "const": "junexis.registry-snapshot/0.1" },
        "snapshotId": { "$ref": "#/$defs/sha256" }
      }
    },
    "cachedArtifacts": {
      "type": "array",
      "maxItems": 10000,
      "uniqueItems": true,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["sha256", "sizeBytes"],
        "properties": {
          "sha256": { "$ref": "#/$defs/sha256" },
          "sizeBytes": { "$ref": "#/$defs/artifactSize" }
        }
      }
    }
  },
  "$defs": {
    "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}(?![\\s\\S])" },
    "artifactSize": { "type": "integer", "minimum": 1, "maximum": 1073741824 }
  }
}
