diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go
index 4efa65daf6..b1bc1a6308 100644
--- a/routers/api/v1/api.go
+++ b/routers/api/v1/api.go
@@ -6,7 +6,7 @@
 //
 // This documentation describes the Gitea API.
 //
-//	Schemes: http, https
+//	Schemes: https, http
 //	BasePath: /api/v1
 //	Version: {{AppVer | JSEscape | Safe}}
 //	License: MIT http://opensource.org/licenses/MIT
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index f81b956390..4ce7b5e974 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -8,8 +8,8 @@
     "text/html"
   ],
   "schemes": [
-    "http",
-    "https"
+    "https",
+    "http"
   ],
   "swagger": "2.0",
   "info": {