From 70fab7e26a76dcf31300f2961dea206f9e396037 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 15 Apr 2020 15:03:05 +0200 Subject: [PATCH] document 404 responce and meaning (#11073) --- routers/api/v1/user/watch.go | 2 ++ templates/swagger/v1_json.tmpl | 3 +++ 2 files changed, 5 insertions(+) diff --git a/routers/api/v1/user/watch.go b/routers/api/v1/user/watch.go index e54709b599f..1fc736deba5 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 5de98a72ce8..8cb7dbfcc0e 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" } } },