{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Метаданные файлов каталога",
  "description": "Схема автоматически создаваемого catalog/files.yaml.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "format",
    "files"
  ],
  "properties": {
    "format": {
      "const": 1
    },
    "files": {
      "type": "object",
      "propertyNames": {
        "pattern": "^(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\).+/files/.+$"
      },
      "additionalProperties": {
        "$ref": "#/$defs/file"
      }
    }
  },
  "$defs": {
    "file": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "size",
        "sha256"
      ],
      "properties": {
        "size": {
          "type": "integer",
          "minimum": 0
        },
        "sha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        }
      }
    }
  }
}
