From 4ab873571b557a1a037741809fc1c138ef481d7c Mon Sep 17 00:00:00 2001 From: Lars Hvam Date: Fri, 30 Jul 2021 14:53:08 +0200 Subject: [PATCH 1/4] =?UTF-8?q?Swagger=20API:=20rename=20repoAddTop=C3=ADc?= =?UTF-8?q?=20to=20repoAddTopic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This changes the operationId to only contain 7 bit ascii, note "í" instead of "i" --- routers/api/v1/repo/topic.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/api/v1/repo/topic.go b/routers/api/v1/repo/topic.go index 14712f536f8f7..7646eaf82e33a 100644 --- a/routers/api/v1/repo/topic.go +++ b/routers/api/v1/repo/topic.go @@ -126,7 +126,7 @@ func UpdateTopics(ctx *context.APIContext) { // AddTopic adds a topic name to a repo func AddTopic(ctx *context.APIContext) { - // swagger:operation PUT /repos/{owner}/{repo}/topics/{topic} repository repoAddTopíc + // swagger:operation PUT /repos/{owner}/{repo}/topics/{topic} repository repoAddTopic // --- // summary: Add a topic to a repository // produces: From 2fe562d266f93c6b6cc836c51bc68cef11831363 Mon Sep 17 00:00:00 2001 From: Lars Hvam Date: Fri, 30 Jul 2021 14:59:30 +0200 Subject: [PATCH 2/4] Update v1_json.tmpl --- templates/swagger/v1_json.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 238265fd7e0d6..505b7af80638e 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -16,7 +16,7 @@ "description": "This documentation describes the Gitea API.", "title": "Gitea API.", "license": { - "name": "MIT", + "name": "MIT"i "url": "http://opensource.org/licenses/MIT" }, "version": "{{AppVer | JSEscape | Safe}}" @@ -9651,7 +9651,7 @@ "repository" ], "summary": "Add a topic to a repository", - "operationId": "repoAddTopíc", + "operationId": "repoAddTopic", "parameters": [ { "type": "string", From c2b95c01ede4cb6167bd22f8cd588ab25c4ada5a Mon Sep 17 00:00:00 2001 From: Lars Hvam Date: Fri, 30 Jul 2021 15:02:30 +0200 Subject: [PATCH 3/4] Update v1_json.tmpl --- templates/swagger/v1_json.tmpl | 47 ++-------------------------------- 1 file changed, 2 insertions(+), 45 deletions(-) diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 505b7af80638e..97956c0ee889d 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -16,7 +16,7 @@ "description": "This documentation describes the Gitea API.", "title": "Gitea API.", "license": { - "name": "MIT"i + "name": "MIT" "url": "http://opensource.org/licenses/MIT" }, "version": "{{AppVer | JSEscape | Safe}}" @@ -17818,47 +17818,4 @@ "description": "Sudo API request as the user provided as the key. Admin privileges are required.", "type": "apiKey", "name": "Sudo", - "in": "header" - }, - "SudoParam": { - "description": "Sudo API request as the user provided as the key. Admin privileges are required.", - "type": "apiKey", - "name": "sudo", - "in": "query" - }, - "TOTPHeader": { - "description": "Must be used in combination with BasicAuth if two-factor authentication is enabled.", - "type": "apiKey", - "name": "X-GITEA-OTP", - "in": "header" - }, - "Token": { - "type": "apiKey", - "name": "token", - "in": "query" - } - }, - "security": [ - { - "BasicAuth": [] - }, - { - "Token": [] - }, - { - "AccessToken": [] - }, - { - "AuthorizationHeaderToken": [] - }, - { - "SudoParam": [] - }, - { - "SudoHeader": [] - }, - { - "TOTPHeader": [] - } - ] -} + "in": "header From 5b556e2abd9659df602175dbe926b1e1037fc231 Mon Sep 17 00:00:00 2001 From: Lars Hvam Date: Fri, 30 Jul 2021 15:04:50 +0200 Subject: [PATCH 4/4] Update v1_json.tmpl --- templates/swagger/v1_json.tmpl | 47 ++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index 97956c0ee889d..d97ec5ff2d7be 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -16,7 +16,7 @@ "description": "This documentation describes the Gitea API.", "title": "Gitea API.", "license": { - "name": "MIT" + "name": "MIT", "url": "http://opensource.org/licenses/MIT" }, "version": "{{AppVer | JSEscape | Safe}}" @@ -17818,4 +17818,47 @@ "description": "Sudo API request as the user provided as the key. Admin privileges are required.", "type": "apiKey", "name": "Sudo", - "in": "header + "in": "header" + }, + "SudoParam": { + "description": "Sudo API request as the user provided as the key. Admin privileges are required.", + "type": "apiKey", + "name": "sudo", + "in": "query" + }, + "TOTPHeader": { + "description": "Must be used in combination with BasicAuth if two-factor authentication is enabled.", + "type": "apiKey", + "name": "X-GITEA-OTP", + "in": "header" + }, + "Token": { + "type": "apiKey", + "name": "token", + "in": "query" + } + }, + "security": [ + { + "BasicAuth": [] + }, + { + "Token": [] + }, + { + "AccessToken": [] + }, + { + "AuthorizationHeaderToken": [] + }, + { + "SudoParam": [] + }, + { + "SudoHeader": [] + }, + { + "TOTPHeader": [] + } + ] +}