From 4e6e63dca20bc5c1afcb8bb5ae3a6aad8b26d300 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 23 Apr 2024 10:22:43 +0800 Subject: [PATCH] Fix compare api swagger (#30648) The swagger format on #30349 is not right. This PR will fix it. (cherry picked from commit 8924d9b2efd52132876fcd106c625a2a2db7a295) --- routers/api/v1/repo/compare.go | 2 +- templates/swagger/v1_json.tmpl | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/routers/api/v1/repo/compare.go b/routers/api/v1/repo/compare.go index 549b9b7fa..cfd61d768 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 c49c6208e..2473e9600 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -5216,12 +5216,10 @@ "application/json" ], "tags": [ - "Get", - "commit", - "comparison" + "repository" ], "summary": "Get commit comparison information", - "operationId": "information", + "operationId": "repoCompareDiff", "parameters": [ { "type": "string",