From c3c07104126fbf1be7e7d408d71099d16c962e56 Mon Sep 17 00:00:00 2001
From: Giteabot <teabot@gitea.io>
Date: Mon, 13 Mar 2023 16:46:18 -0400
Subject: [PATCH] Purge API comment (#23451) (#23452)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Backport #23451 by @jolheiser

This PR just adds the `purge` query parameter to the swagger docs for
admin user delete.

I considered using the same verbiage we have in the UI, but that seemed
more verbose than descriptions we use elsewhere in swagger. I'm fine if
that's preferred, though, just let me know. 🙂

Signed-off-by: jolheiser <john.olheiser@gmail.com>
Co-authored-by: John Olheiser <john.olheiser@gmail.com>
---
 routers/api/v1/admin/user.go   | 4 ++++
 templates/swagger/v1_json.tmpl | 6 ++++++
 2 files changed, 10 insertions(+)

diff --git a/routers/api/v1/admin/user.go b/routers/api/v1/admin/user.go
index 1fbdab3e55..4192d8654d 100644
--- a/routers/api/v1/admin/user.go
+++ b/routers/api/v1/admin/user.go
@@ -305,6 +305,10 @@ func DeleteUser(ctx *context.APIContext) {
 	//   description: username of user to delete
 	//   type: string
 	//   required: true
+	// - name: purge
+	//   in: query
+	//   description: purge the user from the system completely
+	//   type: boolean
 	// responses:
 	//   "204":
 	//     "$ref": "#/responses/empty"
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index de774deaed..a8433c21d8 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -493,6 +493,12 @@
             "name": "username",
             "in": "path",
             "required": true
+          },
+          {
+            "type": "boolean",
+            "description": "purge the user from the system completely",
+            "name": "purge",
+            "in": "query"
           }
         ],
         "responses": {