{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/commentary-dev/json-schema/commentary-dev-create-draft-comment-request-schema.json",
  "title": "CreateDraftCommentRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/commentary-dev-draft-reviews-api-openapi.yml#/components/schemas/CreateDraftCommentRequest",
  "type": "object",
  "required": [
    "blockId",
    "nodeType",
    "sourceLineStart",
    "sourceLineEnd",
    "bodyMarkdown"
  ],
  "properties": {
    "requestDecision": {
      "type": "boolean"
    },
    "poll": {
      "type": "object"
    },
    "fileId": {
      "type": [
        "string",
        "null"
      ]
    },
    "filePath": {
      "type": [
        "string",
        "null"
      ]
    },
    "blockId": {
      "type": "string"
    },
    "nodeType": {
      "type": "string"
    },
    "sourceLineStart": {
      "type": "integer"
    },
    "sourceLineEnd": {
      "type": "integer"
    },
    "selectedText": {
      "type": [
        "string",
        "null"
      ]
    },
    "prefixText": {
      "type": [
        "string",
        "null"
      ]
    },
    "suffixText": {
      "type": [
        "string",
        "null"
      ]
    },
    "bodyMarkdown": {
      "type": "string"
    },
    "agentAlias": {
      "type": [
        "string",
        "null"
      ]
    },
    "visualTarget": {
      "$ref": "#/$defs/ReviewVisualTarget"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "ReviewVisualTarget": {
      "type": "object",
      "required": [
        "surfaceKind",
        "surfaceId",
        "occurrenceId",
        "sourceKind",
        "sourceLanguage",
        "region",
        "hostArtifactKind",
        "hostFilePath",
        "hostBlockId",
        "editable"
      ],
      "properties": {
        "surfaceKind": {
          "type": "string",
          "enum": [
            "raster_image",
            "svg",
            "mermaid"
          ]
        },
        "surfaceId": {
          "type": "string",
          "maxLength": 256
        },
        "occurrenceId": {
          "type": "string",
          "maxLength": 256
        },
        "sourceKind": {
          "type": "string",
          "enum": [
            "repository",
            "draft",
            "embedded",
            "external"
          ]
        },
        "sourcePath": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2048
        },
        "sourceRef": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 512
        },
        "sourceHash": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 256
        },
        "sourceLanguage": {
          "type": "string",
          "enum": [
            "binary",
            "svg",
            "mermaid",
            "markdown",
            "html"
          ]
        },
        "intrinsicWidth": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1
        },
        "intrinsicHeight": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1
        },
        "viewBox": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 128
        },
        "region": {
          "$ref": "#/$defs/VisualRegion"
        },
        "hostArtifactKind": {
          "type": "string",
          "enum": [
            "markdown",
            "html",
            "form",
            "image",
            "svg",
            "mermaid"
          ]
        },
        "hostFilePath": {
          "type": "string",
          "maxLength": 2048
        },
        "hostBlockId": {
          "type": "string",
          "maxLength": 256
        },
        "sourceLineStart": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1
        },
        "sourceLineEnd": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 1
        },
        "slideId": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 256
        },
        "elementHint": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": false,
          "properties": {
            "id": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 256
            },
            "tagName": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 64
            },
            "accessibleName": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 512
            },
            "title": {
              "type": [
                "string",
                "null"
              ],
              "maxLength": 512
            }
          }
        },
        "editable": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "VisualRegion": {
      "type": "object",
      "required": [
        "x",
        "y",
        "width",
        "height"
      ],
      "properties": {
        "x": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "y": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "width": {
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 1
        },
        "height": {
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 1
        }
      },
      "additionalProperties": false
    }
  }
}