aboutsummaryrefslogtreecommitdiffstats
path: root/templates/swagger
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-01-14 16:37:19 +0100
committerAntoine GIRARD <sapk@users.noreply.github.com>2020-01-14 16:37:19 +0100
commit44de66bf50d1ab9a5acc298063cd942768092a19 (patch)
treefda1b76b954d720dfdfefded22883a51ab52e45e /templates/swagger
parentce274d652f2be03364bc0d0a8cb1b4d1996b16c7 (diff)
downloadgitea-44de66bf50d1ab9a5acc298063cd942768092a19.tar.gz
gitea-44de66bf50d1ab9a5acc298063cd942768092a19.zip
[API] add endpoint to check notifications [Extend #9488] (#9595)
* introduce GET /notifications/new * add TEST * use Sprintf instead of path.Join * Error more verbose * return number of notifications if unreaded exist * 200 http status for available notifications
Diffstat (limited to 'templates/swagger')
-rw-r--r--templates/swagger/v1_json.tmpl35
1 files changed, 35 insertions, 0 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index a2baac1364..8ff4597b2e 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -494,6 +494,23 @@
}
}
},
+ "/notifications/new": {
+ "get": {
+ "tags": [
+ "notification"
+ ],
+ "summary": "Check if unread notifications exist",
+ "operationId": "notifyNewAvailable",
+ "responses": {
+ "200": {
+ "$ref": "#/responses/NotificationCount"
+ },
+ "204": {
+ "description": "No unread notification"
+ }
+ }
+ }
+ },
"/notifications/threads/{id}": {
"get": {
"consumes": [
@@ -10911,6 +10928,18 @@
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
},
+ "NotificationCount": {
+ "description": "NotificationCount number of unread notifications",
+ "type": "object",
+ "properties": {
+ "new": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "New"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
+ },
"NotificationSubject": {
"description": "NotificationSubject contains the notification subject (Issue/Pull/Commit)",
"type": "object",
@@ -12397,6 +12426,12 @@
}
}
},
+ "NotificationCount": {
+ "description": "Number of unread notifications",
+ "schema": {
+ "$ref": "#/definitions/NotificationCount"
+ }
+ },
"NotificationThread": {
"description": "NotificationThread",
"schema": {