Skip to content

Commit

Permalink
Fix Hook & HookList in Swagger (#6432) (#6440)
Browse files Browse the repository at this point in the history
Backport from #6432
  • Loading branch information
segevfiner authored and lafriks committed Mar 27, 2019
1 parent 63f6764 commit e54f7a7
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 7 deletions.
4 changes: 2 additions & 2 deletions routers/api/v1/swagger/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
51 changes: 46 additions & 5 deletions templates/swagger/v1_json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -8824,18 +8868,15 @@
"Hook": {
"description": "Hook",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Branch"
}
"$ref": "#/definitions/Hook"
}
},
"HookList": {
"description": "HookList",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Branch"
"$ref": "#/definitions/Hook"
}
}
},
Expand Down

0 comments on commit e54f7a7

Please sign in to comment.