{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/xtiles-app/json-schema/xtiles-app-write-table-rows-request-schema.json",
  "title": "WriteTableRowsRequest",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/xtiles-app-openapi.json#/components/schemas/WriteTableRowsRequest",
  "required": [
    "operations",
    "url"
  ],
  "type": "object",
  "properties": {
    "url": {
      "minLength": 1,
      "type": "string"
    },
    "operations": {
      "maxItems": 100,
      "minItems": 0,
      "type": "array",
      "items": {
        "$ref": "#/$defs/TableRowOperation"
      }
    },
    "allow_new_options": {
      "type": "boolean",
      "description": "Default false. When true, a label that a select or multiselect column does not have yet is added to that column as a new option, and the cell is written with it; the response then lists the options this call created in `created_options`. A label within one or two letters (or only case/spacing, or two adjacent letters swapped) of an existing option is still refused with `did_you_mean` — a near-duplicate option is never created by a row write. An existing option shorter than four characters counts only an exact match regardless of case or a swap (`Bgu` next to `Bug`), so `P2` next to `P1` is created. When two options are equally near, `did_you_mean` is null and the error names them all. Labels whose numbers differ (`Sprint 12` / `Sprint 13`) are not near-misses. Priority and other system-owned option lists never accept new options. In a multiselect labels are separated by commas, so a comma inside a new label is escaped as `\\,` (`Lviv\\, Ukraine` is one label `Lviv, Ukraine`) and a backslash as `\\\\`; a select reads the same escapes. An empty label is refused. A new label is at most 200 characters and may not contain control characters (line breaks, tabs), and one call adds at most 50 new options; an operation past either limit is refused as `invalid`. The same new label in several cells of one call is created once; a later spelling of it that differs only in case, spacing or a typo is refused with `did_you_mean` naming the first. Options are created before the rows that use them; this is not a transaction, so if creating one fails, the operation that needed it is `failed`, later operations are `skipped`, and options already created stay."
    }
  },
  "$defs": {
    "TableRowOperation": {
      "type": "object",
      "properties": {
        "op": {
          "type": "string",
          "enum": [
            "create",
            "update",
            "delete"
          ]
        },
        "row_id": {
          "type": "string"
        },
        "values": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    }
  }
}