Add API endpoint to reply to pull request review comments (#36683)

Adds a dedicated endpoint for replying to pull request review comments,

```
POST /repos/{owner}/{repo}/pulls/{index}/comments/{id}/replies
{ "body": "..." }
```

The reply is threaded under the same review as the parent comment.

Ref: https://gitea.com/gitea/gitea-mcp/issues/129
Fixes: https://github.com/go-gitea/gitea/issues/37419
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Nicolas <bircni@icloud.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
silverwind
2026-04-27 10:45:59 +02:00
committed by GitHub
parent b45be5b20d
commit 331450b17a
6 changed files with 225 additions and 0 deletions

View File

@@ -14470,6 +14470,75 @@
}
}
},
"/repos/{owner}/{repo}/pulls/{index}/comments/{id}/replies": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"repository"
],
"summary": "Reply to a pull request review comment",
"operationId": "repoCreatePullReviewCommentReply",
"parameters": [
{
"type": "string",
"description": "owner of the repo",
"name": "owner",
"in": "path",
"required": true
},
{
"type": "string",
"description": "name of the repo",
"name": "repo",
"in": "path",
"required": true
},
{
"type": "integer",
"format": "int64",
"description": "index of the pull request",
"name": "index",
"in": "path",
"required": true
},
{
"type": "integer",
"format": "int64",
"description": "id of the review comment to reply to",
"name": "id",
"in": "path",
"required": true
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/CreatePullReviewCommentReplyOptions"
}
}
],
"responses": {
"201": {
"$ref": "#/responses/PullReviewComment"
},
"400": {
"$ref": "#/responses/validationError"
},
"404": {
"$ref": "#/responses/notFound"
},
"422": {
"$ref": "#/responses/validationError"
}
}
}
},
"/repos/{owner}/{repo}/pulls/{index}/commits": {
"get": {
"produces": [
@@ -24088,6 +24157,17 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"CreatePullReviewCommentReplyOptions": {
"description": "CreatePullReviewCommentReplyOptions are options to reply to a pull request review comment",
"type": "object",
"properties": {
"body": {
"type": "string",
"x-go-name": "Body"
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
"CreatePullReviewOptions": {
"description": "CreatePullReviewOptions are options to create a pull request review",
"type": "object",