{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openeik.org/schemas/0.4/assets/pointer.schema.json",
  "$comment": "OpenEik 0.2: folded by tools/fold-schemas.mjs from the proposal assets, which 0.2 makes a rule (decision D5). Written by hand from the text, not generated.",
  "title": "An asset's pointer",
  "description": "What a version's tree holds of an asset at its path assets/<sha256>.<ext> (Part XV, 3, rule 1): the canonical form of {\"asset\": {\"bytes\": <n>, \"sha256\": \"<sha256>\"}}. bytes is the file's length in bytes; sha256 its name's digest, which a reader checks against the name (rule 2). The bytes themselves are kept by the store, beside its objects (section 5).",
  "type": "object",
  "properties": {
    "asset": {
      "type": "object",
      "properties": {
        "bytes": {
          "type": "integer",
          "minimum": 0,
          "maximum": 67108864,
          "description": "the file's length in bytes, at most 64 MiB (Part XV, 4, rule 2)"
        },
        "sha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$",
          "description": "the SHA-256 of the file's bytes, as 64 lowercase hexadecimal digits"
        }
      },
      "required": [
        "bytes",
        "sha256"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "asset"
  ],
  "additionalProperties": false
}
