Skip to content

Commit b4941f7

Browse files
segevfinerlafriks
authored andcommitted
Fix Hook & HookList in Swagger (#6432)
Signed-off-by: Segev Finer <[email protected]>
1 parent 22d3d02 commit b4941f7

File tree

2 files changed

+48
-7
lines changed

2 files changed

+48
-7
lines changed

routers/api/v1/swagger/repo.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ type swaggerResponseReferenceList struct {
6161
// swagger:response Hook
6262
type swaggerResponseHook struct {
6363
// in:body
64-
Body []api.Branch `json:"body"`
64+
Body api.Hook `json:"body"`
6565
}
6666

6767
// HookList
6868
// swagger:response HookList
6969
type swaggerResponseHookList struct {
7070
// in:body
71-
Body []api.Branch `json:"body"`
71+
Body []api.Hook `json:"body"`
7272
}
7373

7474
// Release

templates/swagger/v1_json.tmpl

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7557,6 +7557,50 @@
75577557
},
75587558
"x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
75597559
},
7560+
"Hook": {
7561+
"description": "Hook a hook is a web hook when one repository changed",
7562+
"type": "object",
7563+
"properties": {
7564+
"active": {
7565+
"type": "boolean",
7566+
"x-go-name": "Active"
7567+
},
7568+
"config": {
7569+
"type": "object",
7570+
"additionalProperties": {
7571+
"type": "string"
7572+
},
7573+
"x-go-name": "Config"
7574+
},
7575+
"created_at": {
7576+
"type": "string",
7577+
"format": "date-time",
7578+
"x-go-name": "Created"
7579+
},
7580+
"events": {
7581+
"type": "array",
7582+
"items": {
7583+
"type": "string"
7584+
},
7585+
"x-go-name": "Events"
7586+
},
7587+
"id": {
7588+
"type": "integer",
7589+
"format": "int64",
7590+
"x-go-name": "ID"
7591+
},
7592+
"type": {
7593+
"type": "string",
7594+
"x-go-name": "Type"
7595+
},
7596+
"updated_at": {
7597+
"type": "string",
7598+
"format": "date-time",
7599+
"x-go-name": "Updated"
7600+
}
7601+
},
7602+
"x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
7603+
},
75607604
"Issue": {
75617605
"description": "Issue represents an issue in a repository",
75627606
"type": "object",
@@ -8825,18 +8869,15 @@
88258869
"Hook": {
88268870
"description": "Hook",
88278871
"schema": {
8828-
"type": "array",
8829-
"items": {
8830-
"$ref": "#/definitions/Branch"
8831-
}
8872+
"$ref": "#/definitions/Hook"
88328873
}
88338874
},
88348875
"HookList": {
88358876
"description": "HookList",
88368877
"schema": {
88378878
"type": "array",
88388879
"items": {
8839-
"$ref": "#/definitions/Branch"
8880+
"$ref": "#/definitions/Hook"
88408881
}
88418882
}
88428883
},

0 commit comments

Comments
 (0)