forked from forgejo/forgejo
Fix Swagger JSON autogeneration issues. (#4845)
* Fix Swagger JSON. Remove unnecessary schema references for the forbidden and empty responses Signed-off-by: Andrew Thornton <art27@cantab.net> * Fix swagger API for CreateAccessToken * Fix admin create org swagger * Fix swagger for adminCreateRepo * More swagger fixes Set int64 format for those which are int64 Some more form fixes * Fix swagger description of GET /repos/{owner}/{repo}/pulls
This commit is contained in:
parent
9b2fcadeef
commit
43f9233914
23 changed files with 298 additions and 66 deletions
|
@ -38,6 +38,33 @@ func ListPullRequests(ctx *context.APIContext, form api.ListPullRequestsOptions)
|
|||
// description: name of the repo
|
||||
// type: string
|
||||
// required: true
|
||||
// - name: page
|
||||
// in: query
|
||||
// description: Page number
|
||||
// type: integer
|
||||
// - name: state
|
||||
// in: query
|
||||
// description: "State of pull request: open or closed (optional)"
|
||||
// type: string
|
||||
// enum: [closed, open, all]
|
||||
// - name: sort
|
||||
// in: query
|
||||
// description: "Type of sort"
|
||||
// type: string
|
||||
// enum: [oldest, recentupdate, leastupdate, mostcomment, leastcomment, priority]
|
||||
// - name: milestone
|
||||
// in: query
|
||||
// description: "ID of the milestone"
|
||||
// type: integer
|
||||
// format: int64
|
||||
// - name: labels
|
||||
// in: query
|
||||
// description: "Label IDs"
|
||||
// type: array
|
||||
// collectionFormat: multi
|
||||
// items:
|
||||
// type: integer
|
||||
// format: int64
|
||||
// responses:
|
||||
// "200":
|
||||
// "$ref": "#/responses/PullRequestList"
|
||||
|
@ -101,6 +128,7 @@ func GetPullRequest(ctx *context.APIContext) {
|
|||
// in: path
|
||||
// description: index of the pull request to get
|
||||
// type: integer
|
||||
// format: int64
|
||||
// required: true
|
||||
// responses:
|
||||
// "200":
|
||||
|
@ -301,6 +329,7 @@ func EditPullRequest(ctx *context.APIContext, form api.EditPullRequestOption) {
|
|||
// in: path
|
||||
// description: index of the pull request to edit
|
||||
// type: integer
|
||||
// format: int64
|
||||
// required: true
|
||||
// - name: body
|
||||
// in: body
|
||||
|
@ -430,16 +459,13 @@ func IsPullRequestMerged(ctx *context.APIContext) {
|
|||
// in: path
|
||||
// description: index of the pull request
|
||||
// type: integer
|
||||
// format: int64
|
||||
// required: true
|
||||
// responses:
|
||||
// "204":
|
||||
// description: pull request has been merged
|
||||
// schema:
|
||||
// "$ref": "#/responses/empty"
|
||||
// "404":
|
||||
// description: pull request has not been merged
|
||||
// schema:
|
||||
// "$ref": "#/responses/empty"
|
||||
pr, err := models.GetPullRequestByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index"))
|
||||
if err != nil {
|
||||
if models.IsErrPullRequestNotExist(err) {
|
||||
|
@ -478,6 +504,7 @@ func MergePullRequest(ctx *context.APIContext, form auth.MergePullRequestForm) {
|
|||
// in: path
|
||||
// description: index of the pull request to merge
|
||||
// type: integer
|
||||
// format: int64
|
||||
// required: true
|
||||
// responses:
|
||||
// "200":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue