summaryrefslogtreecommitdiffstats
path: root/modules/context
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-06-05 12:03:12 +0100
committerGitHub <noreply@github.com>2020-06-05 14:03:12 +0300
commitf761a37a0f024ea54c4eee9cbae22377616e84e0 (patch)
treee19dd19da32507b2391b267ce001fceea12ea9ce /modules/context
parent17f8de7a54dd2d04daf0b57f40e1724c0b1ffa65 (diff)
downloadgitea-f761a37a0f024ea54c4eee9cbae22377616e84e0.tar.gz
gitea-f761a37a0f024ea54c4eee9cbae22377616e84e0.zip
Provide diff and patch API endpoints (#11751)
* Provide diff and patch API endpoints The diff and patch endpoints on the main routes are not accessible by token therefore we provide new API based endpoints for these Fix #10923 Signed-off-by: Andrew Thornton <art27@cantab.net> * placate swagger Signed-off-by: Andrew Thornton <art27@cantab.net> * Make the response an actual string Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'modules/context')
-rw-r--r--modules/context/api.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/context/api.go b/modules/context/api.go
index 5d91ac49a3..acecf8f264 100644
--- a/modules/context/api.go
+++ b/modules/context/api.go
@@ -65,6 +65,10 @@ type APINotFound struct{}
// swagger:response redirect
type APIRedirect struct{}
+//APIString is a string response
+// swagger:response string
+type APIString string
+
// Error responds with an error message to client with given obj as the message.
// If status is 500, also it prints error to log.
func (ctx *APIContext) Error(status int, title string, obj interface{}) {