From 2848c5eb8f7333b6791afd296b12d21751d0516b Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Fri, 20 Dec 2019 18:07:12 +0100 Subject: 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 --- modules/context/api.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'modules/context') 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{} -- cgit v1.2.3