aboutsummaryrefslogtreecommitdiffstats
path: root/templates/swagger/v1_json.tmpl
diff options
context:
space:
mode:
authorKemal Zebari <60799661+kemzeb@users.noreply.github.com>2024-05-02 09:33:31 -0700
committerGitHub <noreply@github.com>2024-05-02 16:33:31 +0000
commit872caa17c0a30d95f85ab75c068d606e07bd10b3 (patch)
tree10be5940381d506c90db7390303f9ef551aa771f /templates/swagger/v1_json.tmpl
parent677032d36af9a4052b838e011142d9e0bc706ef5 (diff)
downloadgitea-872caa17c0a30d95f85ab75c068d606e07bd10b3.tar.gz
gitea-872caa17c0a30d95f85ab75c068d606e07bd10b3.zip
Catch and handle unallowed file type errors in issue attachment API (#30791)
Before, we would just throw 500 if a user passes an attachment that is not an allowed type. This commit catches this error and throws a 422 instead since this should be considered a validation error.
Diffstat (limited to 'templates/swagger/v1_json.tmpl')
-rw-r--r--templates/swagger/v1_json.tmpl6
1 files changed, 6 insertions, 0 deletions
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index 0c5e5c974d..5ca499e708 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -7478,6 +7478,9 @@
"404": {
"$ref": "#/responses/error"
},
+ "422": {
+ "$ref": "#/responses/validationError"
+ },
"423": {
"$ref": "#/responses/repoArchivedError"
}
@@ -8097,6 +8100,9 @@
"404": {
"$ref": "#/responses/error"
},
+ "422": {
+ "$ref": "#/responses/validationError"
+ },
"423": {
"$ref": "#/responses/repoArchivedError"
}