{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/maketa-pro/json-schema/maketa-pro-patch-request-schema.json",
  "title": "PatchRequest",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/maketa-pro-openapi.json#/components/schemas/PatchRequest",
  "type": "object",
  "required": [
    "id",
    "baseRev",
    "ops"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "edit": {
      "type": "string",
      "description": "edit-токен (не нужен при x-maketa-key своей доски или linkAccess=edit)"
    },
    "baseRev": {
      "type": "integer",
      "description": "Ревизия, к которой относится патч (rev из последнего /load, /save, /save/patch или /rev). Обязателен."
    },
    "opId": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{1,64}$",
      "description": "Идемпотентность повтора: уникален для каждого патча"
    },
    "ops": {
      "type": "array",
      "maxItems": 2000,
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/PatchOp"
      }
    }
  },
  "$defs": {
    "PatchOp": {
      "type": "object",
      "required": [
        "op",
        "path"
      ],
      "properties": {
        "op": {
          "type": "string",
          "enum": [
            "set",
            "del"
          ]
        },
        "path": {
          "type": "string",
          "description": "name · screensOrder · screens/<sid> (метаданные экрана без nodes) · screens/<sid>/nodes/<nid> (узел целиком) · shared/slots · shared/nodes/<nid>"
        },
        "value": {
          "description": "Для set: строка (name), массив id (screensOrder), объект (мета экрана, узел, слоты)"
        }
      }
    }
  }
}