{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "packageId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512,
      "pattern": "^[^\\s]+$"
    },
    "revisionId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512,
      "pattern": "^[^\\s]+$"
    },
    "action": {
      "type": "string",
      "enum": [
        "create",
        "reply",
        "edit",
        "resolve",
        "reopen",
        "reattach"
      ]
    },
    "path": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1024,
      "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.?(?:/|$))[^\\\\\\u0000]+$"
    },
    "threadId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512,
      "pattern": "^[^\\s]+$"
    },
    "commentId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512,
      "pattern": "^[^\\s]+$"
    },
    "blockId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512,
      "pattern": "^[^\\s]+$"
    },
    "documentVersionId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512,
      "pattern": "^[^\\s]+$"
    },
    "nodeType": {
      "type": "string",
      "maxLength": 100
    },
    "sourceLineStart": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10000000
    },
    "sourceLineEnd": {
      "type": "integer",
      "minimum": 1,
      "maximum": 10000000
    },
    "bodyMarkdown": {
      "type": "string",
      "maxLength": 20000,
      "minLength": 1
    },
    "selectedText": {
      "type": "string",
      "maxLength": 4096
    },
    "prefixText": {
      "type": "string",
      "maxLength": 4096
    },
    "suffixText": {
      "type": "string",
      "maxLength": 4096
    },
    "requestDecision": {
      "type": "boolean"
    },
    "poll": {
      "type": "object"
    }
  },
  "required": [
    "packageId",
    "revisionId",
    "action"
  ],
  "allOf": [
    {
      "if": {
        "properties": {
          "action": {
            "const": "create"
          }
        }
      },
      "then": {
        "required": [
          "path",
          "blockId",
          "bodyMarkdown"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "action": {
            "const": "reply"
          }
        }
      },
      "then": {
        "required": [
          "threadId",
          "bodyMarkdown"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "action": {
            "const": "edit"
          }
        }
      },
      "then": {
        "required": [
          "threadId",
          "commentId",
          "bodyMarkdown"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "action": {
            "const": "resolve"
          }
        }
      },
      "then": {
        "required": [
          "threadId"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "action": {
            "const": "reopen"
          }
        }
      },
      "then": {
        "required": [
          "threadId"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "action": {
            "const": "reattach"
          }
        }
      },
      "then": {
        "required": [
          "threadId",
          "documentVersionId",
          "blockId"
        ]
      }
    }
  ],
  "x-commentary-max-body-bytes": 262144,
  "x-commentary-action-scopes": {
    "resolve": [
      "commentary.comments.status"
    ],
    "reopen": [
      "commentary.comments.status"
    ],
    "reattach": [
      "commentary.comments.status"
    ]
  }
}