{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://jkolantree.github.io/astra/schemas/supplemental-release-identity-v1.schema.json",
  "title": "ASTRA namespaced supplemental detached release identity v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema",
    "repository",
    "repository_id",
    "version",
    "tag",
    "annotated_tag_object",
    "commit",
    "tree",
    "tracked_manifest",
    "release_date",
    "build_epoch",
    "assets",
    "sha256sums_sha256",
    "identity_excludes_self"
  ],
  "properties": {
    "schema": {"const": "https://jkolantree.github.io/astra/schemas/supplemental-release-identity-v1.schema.json"},
    "repository": {"type": "string", "format": "uri"},
    "repository_id": {"type": "integer", "minimum": 1},
    "version": {"type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+-[0-9A-Za-z.-]+$"},
    "tag": {"type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]*-v[0-9]+\\.[0-9]+\\.[0-9]+-[0-9A-Za-z.-]+$"},
    "annotated_tag_object": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
    "commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
    "tree": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
    "tracked_manifest": {"$ref": "#/definitions/fileRecord"},
    "release_date": {"type": "string", "format": "date"},
    "build_epoch": {"type": "string", "format": "date-time"},
    "assets": {
      "type": "array",
      "minItems": 2,
      "uniqueItems": true,
      "items": {"$ref": "#/definitions/fileRecord"}
    },
    "sha256sums_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
    "identity_excludes_self": {"const": true}
  },
  "definitions": {
    "fileRecord": {
      "type": "object",
      "additionalProperties": false,
      "required": ["name", "bytes", "sha256"],
      "properties": {
        "name": {"type": "string", "minLength": 1},
        "bytes": {"type": "integer", "minimum": 1},
        "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
      }
    }
  }
}
