aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorZettat123 <zettat123@gmail.com>2023-03-17 09:04:52 +0800
committerGitHub <noreply@github.com>2023-03-16 21:04:52 -0400
commit301de3ab6b505bccdc3ee94c216e4d44bf508ff2 (patch)
tree3a644f37d86622788643a97028ea8599d6521953 /templates
parent8f8bd3c0cb19d30a4872000d1f8ab554a408f1e7 (diff)
downloadgitea-301de3ab6b505bccdc3ee94c216e4d44bf508ff2.tar.gz
gitea-301de3ab6b505bccdc3ee94c216e4d44bf508ff2.zip
Handle missing `README` in create repos API (#23387) (#23510)
Backport #23387 Close #22934 In `/user/repos` API (and other APIs related to creating repos), user can specify a readme template for auto init. At present, if the specified template does not exist, a `500` will be returned . This PR improved the logic and will return a `400` instead of `500`. Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'templates')
-rw-r--r--templates/swagger/v1_json.tmpl9
1 files changed, 9 insertions, 0 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index a8433c21d8..9bab4ced80 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -713,6 +713,9 @@
"201": {
"$ref": "#/responses/Repository"
},
+ "400": {
+ "$ref": "#/responses/error"
+ },
"403": {
"$ref": "#/responses/forbidden"
},
@@ -1926,6 +1929,9 @@
"201": {
"$ref": "#/responses/Repository"
},
+ "400": {
+ "$ref": "#/responses/error"
+ },
"403": {
"$ref": "#/responses/forbidden"
},
@@ -13229,6 +13235,9 @@
"201": {
"$ref": "#/responses/Repository"
},
+ "400": {
+ "$ref": "#/responses/error"
+ },
"409": {
"description": "The repository with the same name already exists."
},