Skip to content

Commit e54f7a7

Browse files
segevfinerlafriks
authored andcommitted
Fix Hook & HookList in Swagger (#6432) (#6440)
Backport from #6432
1 parent 63f6764 commit e54f7a7

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
@@ -7556,6 +7556,50 @@
75567556
},
75577557
"x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
75587558
},
7559+
"Hook": {
7560+
"description": "Hook a hook is a web hook when one repository changed",
7561+
"type": "object",
7562+
"properties": {
7563+
"active": {
7564+
"type": "boolean",
7565+
"x-go-name": "Active"
7566+
},
7567+
"config": {
7568+
"type": "object",
7569+
"additionalProperties": {
7570+
"type": "string"
7571+
},
7572+
"x-go-name": "Config"
7573+
},
7574+
"created_at": {
7575+
"type": "string",
7576+
"format": "date-time",
7577+
"x-go-name": "Created"
7578+
},
7579+
"events": {
7580+
"type": "array",
7581+
"items": {
7582+
"type": "string"
7583+
},
7584+
"x-go-name": "Events"
7585+
},
7586+
"id": {
7587+
"type": "integer",
7588+
"format": "int64",
7589+
"x-go-name": "ID"
7590+
},
7591+
"type": {
7592+
"type": "string",
7593+
"x-go-name": "Type"
7594+
},
7595+
"updated_at": {
7596+
"type": "string",
7597+
"format": "date-time",
7598+
"x-go-name": "Updated"
7599+
}
7600+
},
7601+
"x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
7602+
},
75597603
"Issue": {
75607604
"description": "Issue represents an issue in a repository",
75617605
"type": "object",
@@ -8824,18 +8868,15 @@
88248868
"Hook": {
88258869
"description": "Hook",
88268870
"schema": {
8827-
"type": "array",
8828-
"items": {
8829-
"$ref": "#/definitions/Branch"
8830-
}
8871+
"$ref": "#/definitions/Hook"
88318872
}
88328873
},
88338874
"HookList": {
88348875
"description": "HookList",
88358876
"schema": {
88368877
"type": "array",
88378878
"items": {
8838-
"$ref": "#/definitions/Branch"
8879+
"$ref": "#/definitions/Hook"
88398880
}
88408881
}
88418882
},

0 commit comments

Comments
 (0)