Skip to content

Commit f340171

Browse files
committed
add swagger CommentReaction response type
1 parent e3b0f1f commit f340171

File tree

3 files changed

+63
-2
lines changed

3 files changed

+63
-2
lines changed

routers/api/v1/repo/issue_comment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ func GetCommentReactions(ctx *context.APIContext, form api.CommentReactionList)
422422
// required: true
423423
// responses:
424424
// "200":
425-
// "$ref": "#/responses/CommentReactions"
425+
// "$ref": "#/responses/CommentReactionList"
426426
comment, err := models.GetCommentByID(ctx.ParamsInt64(":id"))
427427
if err != nil {
428428
if models.IsErrCommentNotExist(err) {

routers/api/v1/swagger/issue.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,17 @@ type swaggerIssueDeadline struct {
8484
// in:body
8585
Body api.IssueDeadline `json:"body"`
8686
}
87+
88+
// CommentReaction
89+
// swagger:response CommentReaction
90+
type swaggerCommentReaction struct {
91+
// in:body
92+
Body api.CommentReactionList `json:"body"`
93+
}
94+
95+
// CommentReactionList
96+
// swagger:response CommentReactionList
97+
type swaggerCommentReactionList struct {
98+
// in:body
99+
Body api.CommentReactionList `json:"body"`
100+
}

templates/swagger/v1_json.tmpl

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3042,7 +3042,7 @@
30423042
],
30433043
"responses": {
30443044
"200": {
3045-
"$ref": "#/responses/CommentReactions"
3045+
"$ref": "#/responses/CommentReactionList"
30463046
}
30473047
}
30483048
},
@@ -7781,6 +7781,41 @@
77817781
},
77827782
"x-go-package": "code.gitea.io/gitea/modules/structs"
77837783
},
7784+
"CommentReaction": {
7785+
"description": "CommentReaction represent comment reactions",
7786+
"type": "object",
7787+
"required": [
7788+
"reaction",
7789+
"users"
7790+
],
7791+
"properties": {
7792+
"count": {
7793+
"type": "integer",
7794+
"format": "int64",
7795+
"x-go-name": "Count"
7796+
},
7797+
"reaction": {
7798+
"type": "string",
7799+
"x-go-name": "Reaction"
7800+
},
7801+
"users": {
7802+
"type": "array",
7803+
"items": {
7804+
"type": "string"
7805+
},
7806+
"x-go-name": "Users"
7807+
}
7808+
},
7809+
"x-go-package": "code.gitea.io/gitea/modules/structs"
7810+
},
7811+
"CommentReactionList": {
7812+
"description": "CommentReactionList is a list of comment reactions",
7813+
"type": "array",
7814+
"items": {
7815+
"$ref": "#/definitions/CommentReaction"
7816+
},
7817+
"x-go-package": "code.gitea.io/gitea/modules/structs"
7818+
},
77847819
"Commit": {
77857820
"type": "object",
77867821
"title": "Commit contains information generated from a Git commit.",
@@ -10959,6 +10994,18 @@
1095910994
}
1096010995
}
1096110996
},
10997+
"CommentReaction": {
10998+
"description": "CommentReaction",
10999+
"schema": {
11000+
"$ref": "#/definitions/CommentReactionList"
11001+
}
11002+
},
11003+
"CommentReactionList": {
11004+
"description": "CommentReactionList",
11005+
"schema": {
11006+
"$ref": "#/definitions/CommentReactionList"
11007+
}
11008+
},
1096211009
"Commit": {
1096311010
"description": "Commit",
1096411011
"schema": {

0 commit comments

Comments
 (0)