{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openeik.org/schemas/0.1/commands/update.schema.json",
  "$comment": "Written by hand from Part V and the member names of the reference vocabulary; tools/generate-schemas.mjs does not make it yet (schemas/commands/README.md).",
  "title": "update",
  "description": "Patches an element (Part V, 4). A member the kind does not define is refused, not dropped (Part V, 1.4).",
  "type": "object",
  "properties": {
    "kind": {
      "const": "update"
    },
    "id": {
      "type": "string",
      "minLength": 1,
      "x-eik-ref": "element"
    },
    "expectedRevision": {
      "type": "integer",
      "minimum": 0
    },
    "patch": {
      "description": "The element members to write (Part V, 4): each replaces the member of that name whole; null removes a member the element may lack. The processor checks the element after the patch against elements/<category>.schema.json.",
      "type": "object",
      "properties": {
        "id": false,
        "category": false,
        "revision": false,
        "topRoofId": false,
        "topCeilingId": false,
        "roofCutId": false,
        "name": {
          "$ref": "../elements/element.schema.json#/properties/name"
        },
        "typeId": {
          "$ref": "../elements/element.schema.json#/properties/typeId"
        },
        "levelId": {
          "$ref": "../elements/element.schema.json#/properties/levelId"
        },
        "offset": {
          "$ref": "../elements/element.schema.json#/properties/offset"
        },
        "height": {
          "$ref": "../elements/element.schema.json#/properties/height"
        },
        "width": {
          "$ref": "../elements/element.schema.json#/properties/width"
        },
        "profile": {
          "$ref": "../elements/element.schema.json#/properties/profile"
        }
      }
    }
  },
  "required": [
    "kind",
    "id",
    "expectedRevision",
    "patch"
  ],
  "additionalProperties": false
}
