{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Update Annotation",
  "description": "Change the surfaces, template, or inputs of one of your annotations. Fields you leave out keep their values. The kind and the entity cannot be changed.",
  "type": "object",
  "properties": {
    "surfaces": {
      "type": "array",
      "title": "Surfaces",
      "description": "Where the Massdriver UI shows the annotation, from 1 to 8 surfaces. Each one is lowercase words joined by dots, up to 64 characters, and starts with the kind of entity the annotation is on, such as `instance.canvas_node`. An annotation on a component can also use `instance` surfaces. A WIDGET annotation has exactly one surface: the name of a widget, such as `instance.usage_bar`.",
      "minItems": 1,
      "maxItems": 8,
      "items": {
        "type": "string",
        "pattern": "^[a-z][a-z_]*(\\.[a-z][a-z_]*)+$",
        "maxLength": 64
      },
      "examples": [["instance.canvas_node"]]
    },
    "template": {
      "type": "string",
      "title": "Template",
      "description": "The Liquid template to show on a NOTE annotation, up to 4096 bytes. Massdriver stores it as written and does not evaluate it.",
      "examples": ["Schema version: {{ instance.stash[\"schema.version\"] }}"]
    },
    "inputs": {
      "type": "object",
      "x-gql-type": "map",
      "title": "Inputs",
      "description": "A JSON object that maps each input of the widget of a WIDGET annotation to a stash entry, and replaces every input. Use the input names from `alphaWidgetCatalog`, and set every required input. Each value has `source` (always `stash`), `scope` (one of `project`, `environment`, `component`, `instance`, or `deployment`, set to an ID in the annotation's project), `key`, and an optional `path` (a list of keys into a JSON entry's data).",
      "examples": [
        {
          "value": {
            "source": "stash",
            "scope": { "instance": "ecomm-prod-database" },
            "key": "connections",
            "path": ["active"]
          },
          "max": {
            "source": "stash",
            "scope": { "instance": "ecomm-prod-database" },
            "key": "connections",
            "path": ["max"]
          }
        }
      ]
    }
  }
}
