summaryrefslogtreecommitdiffstats
path: root/modules/context
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2019-12-20 18:07:12 +0100
committerLauris BH <lauris@nix.lv>2019-12-20 19:07:12 +0200
commit2848c5eb8f7333b6791afd296b12d21751d0516b (patch)
tree67ff6244026174116edbff1b4c4cdb5934401968 /modules/context
parent050a8af4243d7f5fff0a2f492b9166f4dfdf0ecf (diff)
downloadgitea-2848c5eb8f7333b6791afd296b12d21751d0516b.tar.gz
gitea-2848c5eb8f7333b6791afd296b12d21751d0516b.zip
Swagger info corrections (#9441)
* use numbers and not http.Status___ enum * fix test * add many missing swagger responses * code format * Deletion Sould return 204 ... * error handling improvements * if special error type ... then add it to swagger too * one smal nit * invalidTopicsError is []string * valid swagger specification 2.0 - if you add responses swagger can tell you if you do it right :+1: * use ctx.InternalServerError * Revert "use numbers and not http.Status___ enum" This reverts commit b1ff386e2418ed6a7f183e756b13277d701278ef. * use http.Status* enum everywhere
Diffstat (limited to 'modules/context')
-rw-r--r--modules/context/api.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/context/api.go b/modules/context/api.go
index c1de37dd21..fd9983c52b 100644
--- a/modules/context/api.go
+++ b/modules/context/api.go
@@ -39,6 +39,13 @@ type APIValidationError struct {
URL string `json:"url"`
}
+// APIInvalidTopicsError is error format response to invalid topics
+// swagger:response invalidTopicsError
+type APIInvalidTopicsError struct {
+ Topics []string `json:"invalidTopics"`
+ Message string `json:"message"`
+}
+
//APIEmpty is an empty response
// swagger:response empty
type APIEmpty struct{}