aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-04-15 15:03:05 +0200
committerGitHub <noreply@github.com>2020-04-15 16:03:05 +0300
commit70fab7e26a76dcf31300f2961dea206f9e396037 (patch)
treeff4553460871bfe07405f75b2530cac1d9c4f4fe
parent2e85ad665acad1cc96b45d6b1f9032fc4982c3e7 (diff)
downloadgitea-70fab7e26a76dcf31300f2961dea206f9e396037.tar.gz
gitea-70fab7e26a76dcf31300f2961dea206f9e396037.zip
document 404 responce and meaning (#11073)
-rw-r--r--routers/api/v1/user/watch.go2
-rw-r--r--templates/swagger/v1_json.tmpl3
2 files changed, 5 insertions, 0 deletions
diff --git a/routers/api/v1/user/watch.go b/routers/api/v1/user/watch.go
index e54709b599..1fc736deba 100644
--- a/routers/api/v1/user/watch.go
+++ b/routers/api/v1/user/watch.go
@@ -114,6 +114,8 @@ func IsWatching(ctx *context.APIContext) {
// responses:
// "200":
// "$ref": "#/responses/WatchInfo"
+ // "404":
+ // description: User is not watching this repo or repo do not exist
if models.IsWatching(ctx.User.ID, ctx.Repo.Repository.ID) {
ctx.JSON(http.StatusOK, api.WatchInfo{
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index 5de98a72ce..8cb7dbfcc0 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -7411,6 +7411,9 @@
"responses": {
"200": {
"$ref": "#/responses/WatchInfo"
+ },
+ "404": {
+ "description": "User is not watching this repo or repo do not exist"
}
}
},