summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSegev Finer <segev208@gmail.com>2019-03-27 09:03:34 +0200
committerLauris BH <lauris@nix.lv>2019-03-27 09:03:34 +0200
commite54f7a708c3619a3ab0598d2a8c74e809277912d (patch)
tree1d576c9fa48e903739bcc7bf7687861068fefa2a
parent63f6764dce5081f389b6fed9d5839a663e47c791 (diff)
downloadgitea-e54f7a708c3619a3ab0598d2a8c74e809277912d.tar.gz
gitea-e54f7a708c3619a3ab0598d2a8c74e809277912d.zip
Fix Hook & HookList in Swagger (#6432) (#6440)
Backport from #6432
-rw-r--r--routers/api/v1/swagger/repo.go4
-rw-r--r--templates/swagger/v1_json.tmpl51
2 files changed, 48 insertions, 7 deletions
diff --git a/routers/api/v1/swagger/repo.go b/routers/api/v1/swagger/repo.go
index 5ddd32d0b7..0422d3fa10 100644
--- a/routers/api/v1/swagger/repo.go
+++ b/routers/api/v1/swagger/repo.go
@@ -61,14 +61,14 @@ type swaggerResponseReferenceList struct {
// swagger:response Hook
type swaggerResponseHook struct {
// in:body
- Body []api.Branch `json:"body"`
+ Body api.Hook `json:"body"`
}
// HookList
// swagger:response HookList
type swaggerResponseHookList struct {
// in:body
- Body []api.Branch `json:"body"`
+ Body []api.Hook `json:"body"`
}
// Release
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index 4a4b408bb9..f647b2462c 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -7556,6 +7556,50 @@
},
"x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
},
+ "Hook": {
+ "description": "Hook a hook is a web hook when one repository changed",
+ "type": "object",
+ "properties": {
+ "active": {
+ "type": "boolean",
+ "x-go-name": "Active"
+ },
+ "config": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ },
+ "x-go-name": "Config"
+ },
+ "created_at": {
+ "type": "string",
+ "format": "date-time",
+ "x-go-name": "Created"
+ },
+ "events": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "x-go-name": "Events"
+ },
+ "id": {
+ "type": "integer",
+ "format": "int64",
+ "x-go-name": "ID"
+ },
+ "type": {
+ "type": "string",
+ "x-go-name": "Type"
+ },
+ "updated_at": {
+ "type": "string",
+ "format": "date-time",
+ "x-go-name": "Updated"
+ }
+ },
+ "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
+ },
"Issue": {
"description": "Issue represents an issue in a repository",
"type": "object",
@@ -8824,10 +8868,7 @@
"Hook": {
"description": "Hook",
"schema": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/Branch"
- }
+ "$ref": "#/definitions/Hook"
}
},
"HookList": {
@@ -8835,7 +8876,7 @@
"schema": {
"type": "array",
"items": {
- "$ref": "#/definitions/Branch"
+ "$ref": "#/definitions/Hook"
}
}
},