From 91ebc7c475529929736a2c86b0934f33d48c7f2f Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 22 Apr 2024 23:27:41 +0800 Subject: [PATCH 1/2] Fix compare api swagger --- routers/api/v1/repo/compare.go | 2 +- templates/swagger/v1_json.tmpl | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/routers/api/v1/repo/compare.go b/routers/api/v1/repo/compare.go index 549b9b7fa91e8..cfd61d768c507 100644 --- a/routers/api/v1/repo/compare.go +++ b/routers/api/v1/repo/compare.go @@ -16,7 +16,7 @@ import ( // CompareDiff compare two branches or commits func CompareDiff(ctx *context.APIContext) { - // swagger:operation GET /repos/{owner}/{repo}/compare/{basehead} Get commit comparison information + // swagger:operation GET /repos/{owner}/{repo}/compare/{basehead} repository repoCompareDiff // --- // summary: Get commit comparison information // produces: diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 532b8880bc82c..d9f09758ed3b1 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -5346,12 +5346,10 @@ "application/json" ], "tags": [ - "Get", - "commit", - "comparison" + "repository" ], "summary": "Get commit comparison information", - "operationId": "information", + "operationId": "repoCompareDiff", "parameters": [ { "type": "string", @@ -25633,4 +25631,4 @@ "TOTPHeader": [] } ] -} +} \ No newline at end of file From 27e526a89c96cf7483010cb4ef9a8332555425d8 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 23 Apr 2024 09:55:01 +0800 Subject: [PATCH 2/2] Add end line for v1_json.tmpl --- templates/swagger/v1_json.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index d9f09758ed3b1..faf57454d7a62 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -25631,4 +25631,4 @@ "TOTPHeader": [] } ] -} \ No newline at end of file +}