aboutsummaryrefslogtreecommitdiffstats
path: root/templates/swagger
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2019-12-07 23:04:19 +0100
committertechknowlogick <techknowlogick@gitea.io>2019-12-07 17:04:19 -0500
commit37e10d4543c1e516e1a721d72c0054fefceb9499 (patch)
treef824b014a135d3bcf243d5bb3e87cab3de225c90 /templates/swagger
parentee7df7ba8c5e6a4b32b0c4048d2b535d8df3cbe9 (diff)
downloadgitea-37e10d4543c1e516e1a721d72c0054fefceb9499.tar.gz
gitea-37e10d4543c1e516e1a721d72c0054fefceb9499.zip
[API] Add Reactions (#9220)
* reject reactions wich ar not allowed * dont duble check CreateReaction now throw ErrForbiddenIssueReaction * add /repos/{owner}/{repo}/issues/comments/{id}/reactions endpoint * add Find Functions * fix some swagger stuff + add issue reaction endpoints + GET ReactionList now use FindReactions... * explicite Issue Only Reaction for FindReactionsOptions with "-1" commentID * load issue; load user ... * return error again * swagger def canged after LINT * check if user has ben loaded * add Tests * better way of comparing results * add suggestion * use different issue for test (dont interfear with integration test) * test dont compare Location on timeCompare * TEST: add forbidden dubble add * add comments in code to explain * add settings.UI.ReactionsMap so if !setting.UI.ReactionsMap[opts.Type] works
Diffstat (limited to 'templates/swagger')
-rw-r--r--templates/swagger/v1_json.tmpl335
1 files changed, 335 insertions, 0 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index 1d8cd36858..9c8db28817 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -3016,6 +3016,148 @@
}
}
},
+ "/repos/{owner}/{repo}/issues/comments/{id}/reactions": {
+ "get": {
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "issue"
+ ],
+ "summary": "Get a list reactions of a issue comment",
+ "operationId": "issueGetCommentReactions",
+ "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": "id of the comment to edit",
+ "name": "id",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/ReactionResponseList"
+ }
+ }
+ },
+ "post": {
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "issue"
+ ],
+ "summary": "Add a reaction to a comment of a issue comment",
+ "operationId": "issuePostCommentReaction",
+ "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": "id of the comment to edit",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "name": "content",
+ "in": "body",
+ "schema": {
+ "$ref": "#/definitions/EditReactionOption"
+ }
+ }
+ ],
+ "responses": {
+ "201": {
+ "$ref": "#/responses/ReactionResponse"
+ }
+ }
+ },
+ "delete": {
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "issue"
+ ],
+ "summary": "Remove a reaction from a comment of a issue comment",
+ "operationId": "issueDeleteCommentReaction",
+ "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": "id of the comment to edit",
+ "name": "id",
+ "in": "path",
+ "required": true
+ },
+ {
+ "name": "content",
+ "in": "body",
+ "schema": {
+ "$ref": "#/definitions/EditReactionOption"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/empty"
+ }
+ }
+ }
+ },
"/repos/{owner}/{repo}/issues/{id}/times": {
"get": {
"produces": [
@@ -3688,6 +3830,148 @@
}
}
},
+ "/repos/{owner}/{repo}/issues/{index}/reactions": {
+ "get": {
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "issue"
+ ],
+ "summary": "Get a list reactions of a issue",
+ "operationId": "issueGetIssueReactions",
+ "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 issue",
+ "name": "index",
+ "in": "path",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/ReactionResponseList"
+ }
+ }
+ },
+ "post": {
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "issue"
+ ],
+ "summary": "Add a reaction to a comment of a issue",
+ "operationId": "issuePostIssueReaction",
+ "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 issue",
+ "name": "index",
+ "in": "path",
+ "required": true
+ },
+ {
+ "name": "content",
+ "in": "body",
+ "schema": {
+ "$ref": "#/definitions/EditReactionOption"
+ }
+ }
+ ],
+ "responses": {
+ "201": {
+ "$ref": "#/responses/ReactionResponse"
+ }
+ }
+ },
+ "delete": {
+ "consumes": [
+ "application/json"
+ ],
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "issue"
+ ],
+ "summary": "Remove a reaction from a comment of a issue",
+ "operationId": "issueDeleteIssueReaction",
+ "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 issue",
+ "name": "index",
+ "in": "path",
+ "required": true
+ },
+ {
+ "name": "content",
+ "in": "body",
+ "schema": {
+ "$ref": "#/definitions/EditReactionOption"
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "$ref": "#/responses/empty"
+ }
+ }
+ }
+ },
"/repos/{owner}/{repo}/issues/{index}/stopwatch/start": {
"post": {
"consumes": [
@@ -8721,6 +9005,17 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "EditReactionOption": {
+ "description": "EditReactionOption contain the reaction type",
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string",
+ "x-go-name": "Reaction"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
"EditReleaseOption": {
"description": "EditReleaseOption options when editing a release",
"type": "object",
@@ -10095,6 +10390,25 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "ReactionResponse": {
+ "description": "ReactionResponse contain one reaction",
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string",
+ "x-go-name": "Reaction"
+ },
+ "created_at": {
+ "type": "string",
+ "format": "date-time",
+ "x-go-name": "Created"
+ },
+ "user": {
+ "$ref": "#/definitions/User"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
"Reference": {
"type": "object",
"title": "Reference represents a Git reference.",
@@ -10960,6 +11274,12 @@
}
}
},
+ "EditReactionOption": {
+ "description": "EditReactionOption",
+ "schema": {
+ "$ref": "#/definitions/EditReactionOption"
+ }
+ },
"EmailList": {
"description": "EmailList",
"schema": {
@@ -11146,6 +11466,21 @@
}
}
},
+ "ReactionResponse": {
+ "description": "ReactionResponse",
+ "schema": {
+ "$ref": "#/definitions/ReactionResponse"
+ }
+ },
+ "ReactionResponseList": {
+ "description": "ReactionResponseList",
+ "schema": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/ReactionResponse"
+ }
+ }
+ },
"Reference": {
"description": "Reference",
"schema": {