{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://usemakoto.dev/schema/v0.3/dataset-manifest.schema.json",
  "title": "Makoto v0.3 Dataset Manifest",
  "type": "object",
  "required": ["version", "entries"],
  "properties": {
    "version": { "const": "0.3" },
    "entries": {
      "type": "array",
      "minItems": 1,
      "items": { "$ref": "#/$defs/entry" }
    }
  },
  "$defs": {
    "digest": {
      "type": "object",
      "required": ["sha256"],
      "properties": { "sha256": { "type": "string", "minLength": 64, "maxLength": 64 } },
      "additionalProperties": false
    },
    "logicalPath": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024
    },
    "entry": {
      "type": "object",
      "required": ["name", "digest"],
      "properties": {
        "name": { "$ref": "#/$defs/logicalPath" },
        "digest": { "$ref": "#/$defs/digest" },
        "size": { "type": "integer", "minimum": 0, "maximum": 9223372036854775807 },
        "mediaType": {
          "type": "string",
          "maxLength": 255
        },
        "recordMerkle": { "$ref": "#/$defs/recordMerkle" }
      },
      "additionalProperties": false
    },
    "recordMerkle": {
      "type": "object",
      "required": ["algorithm", "recordCount", "root"],
      "properties": {
        "algorithm": { "const": "rfc6962-sha256-record-digest-v1" },
        "recordCount": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9223372036854775807
        },
        "root": { "$ref": "#/$defs/digest" }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
