From 1fd2beb6e974bb2d18204864f3f7a9d903200941 Mon Sep 17 00:00:00 2001 From: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> Date: Sat, 27 Jun 2020 22:32:28 +0200 Subject: [PATCH] Fix swagger docs for /repos/issues (#12069) Co-authored-by: Lauris BH --- routers/api/v1/repo/issue.go | 2 ++ templates/swagger/v1_json.tmpl | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/routers/api/v1/repo/issue.go b/routers/api/v1/repo/issue.go index 937b581a6..a06448249 100644 --- a/routers/api/v1/repo/issue.go +++ b/routers/api/v1/repo/issue.go @@ -198,6 +198,7 @@ func ListIssues(ctx *context.APIContext) { // in: query // description: whether issue is open or closed // type: string + // enum: [closed, open, all] // - name: labels // in: query // description: comma separated list of labels. Fetch only issues that have any of this labels. Non existent labels are discarded @@ -210,6 +211,7 @@ func ListIssues(ctx *context.APIContext) { // in: query // description: filter by type (issues / pulls) if set // type: string + // enum: [issues, pulls] // - name: milestones // in: query // description: comma separated list of milestone names or ids. It uses names and fall back to ids. Fetch only issues that have any of this milestones. Non existent milestones are discarded diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 1226822cc..9290bfe07 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -3776,6 +3776,11 @@ "required": true }, { + "enum": [ + "closed", + "open", + "all" + ], "type": "string", "description": "whether issue is open or closed", "name": "state", @@ -3794,6 +3799,10 @@ "in": "query" }, { + "enum": [ + "issues", + "pulls" + ], "type": "string", "description": "filter by type (issues / pulls) if set", "name": "type",