]> source.dussan.org Git - gitea.git/commitdiff
Fix Swagger JSON autogeneration issues. (#4845)
authorzeripath <art27@cantab.net>
Sun, 21 Oct 2018 03:40:42 +0000 (04:40 +0100)
committertechknowlogick <hello@techknowlogick.com>
Sun, 21 Oct 2018 03:40:42 +0000 (23:40 -0400)
* 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

23 files changed:
routers/api/v1/admin/org.go
routers/api/v1/admin/repo.go
routers/api/v1/admin/user.go
routers/api/v1/org/hook.go
routers/api/v1/org/member.go
routers/api/v1/org/team.go
routers/api/v1/repo/hook.go
routers/api/v1/repo/issue.go
routers/api/v1/repo/issue_comment.go
routers/api/v1/repo/issue_label.go
routers/api/v1/repo/issue_tracked_time.go
routers/api/v1/repo/key.go
routers/api/v1/repo/label.go
routers/api/v1/repo/milestone.go
routers/api/v1/repo/pull.go
routers/api/v1/repo/release.go
routers/api/v1/repo/release_attachment.go
routers/api/v1/repo/repo.go
routers/api/v1/user/app.go
routers/api/v1/user/gpg_key.go
routers/api/v1/user/key.go
routers/api/v1/user/user.go
templates/swagger/v1_json.tmpl

index d247b51c726e600e1278bd042e872ec86610d278..406cbb9a31f27eb2a1474f588dcf5a93930b880f 100644 (file)
@@ -28,6 +28,10 @@ func CreateOrg(ctx *context.APIContext, form api.CreateOrgOption) {
        //   description: username of the user that will own the created organization
        //   type: string
        //   required: true
+       // - name: organization
+       //   in: body
+       //   required: true
+       //   schema: { "$ref": "#/definitions/CreateOrgOption" }
        // responses:
        //   "201":
        //     "$ref": "#/responses/Organization"
index 70765557fb58e68396d47baf5b601f004ca617a3..d883e2cbd0eb376f08b0472c701e17e18a39d1cc 100644 (file)
@@ -27,6 +27,10 @@ func CreateRepo(ctx *context.APIContext, form api.CreateRepoOption) {
        //   description: username of the user. This user will own the created repository
        //   type: string
        //   required: true
+       // - name: repository
+       //   in: body
+       //   required: true
+       //   schema: { "$ref": "#/definitions/CreateRepoOption" }
        // responses:
        //   "201":
        //     "$ref": "#/responses/Repository"
index 958c083fb6f9eb526487a16efdebd0fa73a5d785..cff8ae4850f0bbb974023a4593d40cfac69d6462 100644 (file)
@@ -228,6 +228,10 @@ func CreatePublicKey(ctx *context.APIContext, form api.CreateKeyOption) {
        //   description: username of the user
        //   type: string
        //   required: true
+       // - name: key
+       //   in: body
+       //   schema:
+       //     "$ref": "#/definitions/CreateKeyOption"
        // responses:
        //   "201":
        //     "$ref": "#/responses/PublicKey"
@@ -259,6 +263,7 @@ func DeleteUserPublicKey(ctx *context.APIContext) {
        //   in: path
        //   description: id of the key to delete
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "204":
index 83d2a5e5ba0754dc1fa7c7098961e40b4f9c5e7b..84559a958e3c15b8753c904b84f9ce77e2f8d036 100644 (file)
@@ -59,6 +59,7 @@ func GetHook(ctx *context.APIContext) {
        //   in: path
        //   description: id of the hook to get
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "200":
@@ -87,6 +88,11 @@ func CreateHook(ctx *context.APIContext, form api.CreateHookOption) {
        //   description: name of the organization
        //   type: string
        //   required: true
+       // - name: body
+       //   in: body
+       //   required: true
+       //   schema:
+       //     "$ref": "#/definitions/CreateHookOption"
        // responses:
        //   "201":
        //     "$ref": "#/responses/Hook"
@@ -117,7 +123,12 @@ func EditHook(ctx *context.APIContext, form api.EditHookOption) {
        //   in: path
        //   description: id of the hook to update
        //   type: integer
+       //   format: int64
        //   required: true
+       // - name: body
+       //   in: body
+       //   schema:
+       //     "$ref": "#/definitions/EditHookOption"
        // responses:
        //   "200":
        //     "$ref": "#/responses/Hook"
@@ -144,6 +155,7 @@ func DeleteHook(ctx *context.APIContext) {
        //   in: path
        //   description: id of the hook to delete
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "204":
index 65754b88ecd338c0f221e2c8fe853dfd5032af2d..b66d86c66032c9be4e0d80a97ed45eeb4bb775d6 100644 (file)
@@ -117,12 +117,8 @@ func IsMember(ctx *context.APIContext) {
        // responses:
        //   "204":
        //     description: user is a member
-       //     schema:
-       //       "$ref": "#/responses/empty"
        //   "404":
        //     description: user is not a member
-       //     schema:
-       //       "$ref": "#/responses/empty"
        userToCheck := user.GetUserByParams(ctx)
        if ctx.Written() {
                return
@@ -172,12 +168,8 @@ func IsPublicMember(ctx *context.APIContext) {
        // responses:
        //   "204":
        //     description: user is a public member
-       //     schema:
-       //       "$ref": "#/responses/empty"
        //   "404":
        //     description: user is not a public member
-       //     schema:
-       //       "$ref": "#/responses/empty"
        userToCheck := user.GetUserByParams(ctx)
        if ctx.Written() {
                return
@@ -210,8 +202,6 @@ func PublicizeMember(ctx *context.APIContext) {
        // responses:
        //   "204":
        //     description: membership publicized
-       //     schema:
-       //       "$ref": "#/responses/empty"
        userToPublicize := user.GetUserByParams(ctx)
        if ctx.Written() {
                return
@@ -286,8 +276,6 @@ func DeleteMember(ctx *context.APIContext) {
        // responses:
        //   "204":
        //     description: member removed
-       //     schema:
-       //       "$ref": "#/responses/empty"
        member := user.GetUserByParams(ctx)
        if ctx.Written() {
                return
index b8dd026bf30e810eaeb0ff278ad6782de860d63c..2e319a18310cea5ed3dfd41de60d8a6d2882b387 100644 (file)
@@ -54,6 +54,7 @@ func GetTeam(ctx *context.APIContext) {
        //   in: path
        //   description: id of the team to get
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "200":
@@ -144,12 +145,11 @@ func DeleteTeam(ctx *context.APIContext) {
        //   in: path
        //   description: id of the team to delete
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "204":
        //     description: team deleted
-       //     schema:
-       //       "$ref": "#/responses/empty"
        if err := models.DeleteTeam(ctx.Org.Team); err != nil {
                ctx.Error(500, "DeleteTeam", err)
                return
@@ -169,6 +169,7 @@ func GetTeamMembers(ctx *context.APIContext) {
        //   in: path
        //   description: id of the team
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "200":
@@ -205,6 +206,7 @@ func AddTeamMember(ctx *context.APIContext) {
        //   in: path
        //   description: id of the team
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: username
        //   in: path
@@ -237,6 +239,7 @@ func RemoveTeamMember(ctx *context.APIContext) {
        //   in: path
        //   description: id of the team
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: username
        //   in: path
@@ -270,6 +273,7 @@ func GetTeamRepos(ctx *context.APIContext) {
        //   in: path
        //   description: id of the team
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "200":
@@ -316,6 +320,7 @@ func AddTeamRepository(ctx *context.APIContext) {
        //   in: path
        //   description: id of the team
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: org
        //   in: path
@@ -362,6 +367,7 @@ func RemoveTeamRepository(ctx *context.APIContext) {
        //   in: path
        //   description: id of the team
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: org
        //   in: path
index 1f121dfc387b17c32d56f3d6bb978e452e3fad30..369603694fd4211a9e17d8e8a5d9a2c779161bba 100644 (file)
@@ -69,6 +69,7 @@ func GetHook(ctx *context.APIContext) {
        //   in: path
        //   description: id of the hook to get
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "200":
@@ -104,6 +105,7 @@ func TestHook(ctx *context.APIContext) {
        //   in: path
        //   description: id of the hook to test
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "204":
@@ -193,6 +195,7 @@ func EditHook(ctx *context.APIContext, form api.EditHookOption) {
        //   in: path
        //   description: index of the hook
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: body
        //   in: body
@@ -227,6 +230,7 @@ func DeleteHook(ctx *context.APIContext) {
        //   in: path
        //   description: id of the hook to delete
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "204":
index 4b634c9ca602c6e839981a915b9fe75f036cc9fb..cd78135a6216085916b49bf6d025ca11e97c49c4 100644 (file)
@@ -123,6 +123,7 @@ func GetIssue(ctx *context.APIContext) {
        //   in: path
        //   description: index of the issue to get
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "200":
@@ -254,6 +255,7 @@ func EditIssue(ctx *context.APIContext, form api.EditIssueOption) {
        //   in: path
        //   description: index of the issue to edit
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: body
        //   in: body
@@ -377,6 +379,7 @@ func UpdateIssueDeadline(ctx *context.APIContext, form api.EditDeadlineOption) {
        //   in: path
        //   description: index of the issue to create or update a deadline on
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: body
        //   in: body
@@ -387,12 +390,8 @@ func UpdateIssueDeadline(ctx *context.APIContext, form api.EditDeadlineOption) {
        //     "$ref": "#/responses/IssueDeadline"
        //   "403":
        //     description: Not repo writer
-       //     schema:
-       //       "$ref": "#/responses/forbidden"
        //   "404":
        //     description: Issue not found
-       //     schema:
-       //       "$ref": "#/responses/empty"
 
        issue, err := models.GetIssueByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index"))
        if err != nil {
index f958922914f7a15bbeea5fd37a1be479a371ec34..3af0290585f9eafe04d0f4290904da19823ed935 100644 (file)
@@ -36,6 +36,7 @@ func ListIssueComments(ctx *context.APIContext) {
        //   in: path
        //   description: index of the issue
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: since
        //   in: query
@@ -144,6 +145,7 @@ func CreateIssueComment(ctx *context.APIContext, form api.CreateIssueCommentOpti
        //   in: path
        //   description: index of the issue
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: body
        //   in: body
@@ -193,6 +195,7 @@ func EditIssueComment(ctx *context.APIContext, form api.EditIssueCommentOption)
        //   in: path
        //   description: id of the comment to edit
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: body
        //   in: body
@@ -234,6 +237,7 @@ func EditIssueCommentDeprecated(ctx *context.APIContext, form api.EditIssueComme
        //   in: path
        //   description: id of the comment to edit
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: body
        //   in: body
@@ -293,6 +297,7 @@ func DeleteIssueComment(ctx *context.APIContext) {
        //   in: path
        //   description: id of comment to delete
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "204":
@@ -326,6 +331,7 @@ func DeleteIssueCommentDeprecated(ctx *context.APIContext) {
        //   in: path
        //   description: id of comment to delete
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "204":
index 3657f02c65299380928793b1355f093a7a3c781c..35defa25b57d1c546f3a4246849f43f7c88e7e64 100644 (file)
@@ -33,6 +33,7 @@ func ListIssueLabels(ctx *context.APIContext) {
        //   in: path
        //   description: index of the issue
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "200":
@@ -80,6 +81,7 @@ func AddIssueLabels(ctx *context.APIContext, form api.IssueLabelsOption) {
        //   in: path
        //   description: index of the issue
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: body
        //   in: body
@@ -149,11 +151,13 @@ func DeleteIssueLabel(ctx *context.APIContext) {
        //   in: path
        //   description: index of the issue
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: id
        //   in: path
        //   description: id of the label to remove
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "204":
@@ -215,6 +219,7 @@ func ReplaceIssueLabels(ctx *context.APIContext, form api.IssueLabelsOption) {
        //   in: path
        //   description: index of the issue
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: body
        //   in: body
@@ -284,6 +289,7 @@ func ClearIssueLabels(ctx *context.APIContext) {
        //   in: path
        //   description: index of the issue
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "204":
index 9be9fee91a424657685d783dbb16cad322802977..6c29b11b4bb0747c8ec9e0f4807af7e61b1e9eeb 100644 (file)
@@ -41,6 +41,7 @@ func ListTrackedTimes(ctx *context.APIContext) {
        //   in: path
        //   description: index of the issue
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "200":
@@ -92,6 +93,7 @@ func AddTime(ctx *context.APIContext, form api.AddTimeOption) {
        //   in: path
        //   description: index of the issue to add tracked time to
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: body
        //   in: body
index 1e3666ed42d75fbf508f3145bea89fa94c3c1d3d..89a550cfd318fa38e50dd3f140af4965b933655d 100644 (file)
@@ -81,6 +81,7 @@ func GetDeployKey(ctx *context.APIContext) {
        //   in: path
        //   description: id of the key to get
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "200":
@@ -191,6 +192,7 @@ func DeleteDeploykey(ctx *context.APIContext) {
        //   in: path
        //   description: id of the key to delete
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "204":
index 77392787ef5ef1437ce523dc252cb0b3b48c3f04..359ccf0e41eca0a56ed2217354ee052c4f7d8001 100644 (file)
@@ -69,6 +69,7 @@ func GetLabel(ctx *context.APIContext) {
        //   in: path
        //   description: id of the label to get
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "200":
@@ -163,6 +164,7 @@ func EditLabel(ctx *context.APIContext, form api.EditLabelOption) {
        //   in: path
        //   description: id of the label to edit
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: body
        //   in: body
@@ -219,6 +221,7 @@ func DeleteLabel(ctx *context.APIContext) {
        //   in: path
        //   description: id of the label to delete
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "204":
index a138cb7a69a0ced1e5dd96df27029cdaa2b5adbe..c621536ad720cc18944049e325e97d25a33ba6a7 100644 (file)
@@ -70,6 +70,7 @@ func GetMilestone(ctx *context.APIContext) {
        //   in: path
        //   description: id of the milestone
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "200":
@@ -156,6 +157,7 @@ func EditMilestone(ctx *context.APIContext, form api.EditMilestoneOption) {
        //   in: path
        //   description: id of the milestone
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: body
        //   in: body
@@ -211,6 +213,7 @@ func DeleteMilestone(ctx *context.APIContext) {
        //   in: path
        //   description: id of the milestone to delete
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "204":
index 0ec2d368711f2914cbeac1d447a76fc300bfe28e..5ce6f868bcd09febbd6b694a258d930bca52512b 100644 (file)
@@ -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":
index 7c3de3581b11bf60e77947824dbf1fbd1d1f3e11..282ff582c509f5179803866dfce80014c1509e99 100644 (file)
@@ -33,6 +33,7 @@ func GetRelease(ctx *context.APIContext) {
        //   in: path
        //   description: id of the release to get
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "200":
@@ -199,6 +200,7 @@ func EditRelease(ctx *context.APIContext, form api.EditReleaseOption) {
        //   in: path
        //   description: id of the release to edit
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: body
        //   in: body
@@ -278,6 +280,7 @@ func DeleteRelease(ctx *context.APIContext) {
        //   in: path
        //   description: id of the release to delete
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "204":
index f11fac16294e57e486f3391744a22e6e036da0aa..ea2be719f377e5dff324abeb53b5f5c95565b61a 100644 (file)
@@ -38,11 +38,13 @@ func GetReleaseAttachment(ctx *context.APIContext) {
        //   in: path
        //   description: id of the release
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: attachment_id
        //   in: path
        //   description: id of the attachment to get
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "200":
@@ -84,6 +86,7 @@ func ListReleaseAttachments(ctx *context.APIContext) {
        //   in: path
        //   description: id of the release
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "200":
@@ -129,6 +132,7 @@ func CreateReleaseAttachment(ctx *context.APIContext) {
        //   in: path
        //   description: id of the release
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: name
        //   in: query
@@ -233,11 +237,13 @@ func EditReleaseAttachment(ctx *context.APIContext, form api.EditAttachmentOptio
        //   in: path
        //   description: id of the release
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: attachment_id
        //   in: path
        //   description: id of the attachment to edit
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: body
        //   in: body
@@ -292,11 +298,13 @@ func DeleteReleaseAttachment(ctx *context.APIContext) {
        //   in: path
        //   description: id of the release
        //   type: integer
+       //   format: int64
        //   required: true
        // - name: attachment_id
        //   in: path
        //   description: id of the attachment to delete
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "204":
index e48b100af61cb86cfd493ecbbaf1f1a9cb4cf51e..bf6346eebdfcadef3a7d8332e8855ea0758f9e5a 100644 (file)
@@ -53,6 +53,7 @@ func Search(ctx *context.APIContext) {
        //   in: query
        //   description: search only for repos that the user with the given id owns or contributes to
        //   type: integer
+       //   format: int64
        // - name: page
        //   in: query
        //   description: page number of results to return (1-based)
@@ -453,6 +454,7 @@ func GetByID(ctx *context.APIContext) {
        //   in: path
        //   description: id of the repo to get
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "200":
index 216190b0f0b9397dca7ddb22148d3c63c542fad6..f4870431c202f4db5c7b7c829856a38b67908be1 100644 (file)
@@ -60,6 +60,15 @@ func CreateAccessToken(ctx *context.APIContext, form api.CreateAccessTokenOption
        //   description: username of user
        //   type: string
        //   required: true
+       // - name: accessToken
+       //   in: body
+       //   schema:
+       //     type: object
+       //     required:
+       //       - name
+       //     properties:
+       //       name:
+       //         type: string
        // responses:
        //   "200":
        //     "$ref": "#/responses/AccessToken"
@@ -95,6 +104,7 @@ func DeleteAccessToken(ctx *context.APIContext) {
        //   in: path
        //   description: token to be deleted
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "204":
index a955f3ff1480cc4ddeb7d6c9464dbc8b0691cd26..5301a0f2dbbcd08d2615d8b79226a11ed7b94ebb 100644 (file)
@@ -80,6 +80,7 @@ func GetGPGKey(ctx *context.APIContext) {
        //   in: path
        //   description: id of key to get
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "200":
@@ -143,6 +144,7 @@ func DeleteGPGKey(ctx *context.APIContext) {
        //   in: path
        //   description: id of key to delete
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "204":
index 41a514af5e458bfbce965e84a2a03219912fe7c4..e5d1b08f0dab58fc256063d422792ae5df67530a 100644 (file)
@@ -101,6 +101,7 @@ func GetPublicKey(ctx *context.APIContext) {
        //   in: path
        //   description: id of key to get
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "200":
@@ -172,6 +173,7 @@ func DeletePublicKey(ctx *context.APIContext) {
        //   in: path
        //   description: id of key to delete
        //   type: integer
+       //   format: int64
        //   required: true
        // responses:
        //   "204":
index 38576a7337df2e6b3fa3d5442358d507003023c8..51d69aa2c32cf32937a91b7efafdbef659c02f3b 100644 (file)
@@ -31,6 +31,7 @@ func Search(ctx *context.APIContext) {
        //   in: query
        //   description: ID of the user to search for
        //   type: integer
+       //   format: int64
        // - name: limit
        //   in: query
        //   description: maximum number of users to return
index e6cdfc0270ee39ceda3a71f023b2e7f9c486bcb5..193579f6bed735c3baa184e4c07c4b8765e9f253 100644 (file)
             "name": "username",
             "in": "path",
             "required": true
+          },
+          {
+            "name": "key",
+            "in": "body",
+            "schema": {
+              "$ref": "#/definitions/CreateKeyOption"
+            }
           }
         ],
         "responses": {
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the key to delete",
             "name": "id",
             "in": "path",
             "name": "username",
             "in": "path",
             "required": true
+          },
+          {
+            "name": "organization",
+            "in": "body",
+            "required": true,
+            "schema": {
+              "$ref": "#/definitions/CreateOrgOption"
+            }
           }
         ],
         "responses": {
             "name": "username",
             "in": "path",
             "required": true
+          },
+          {
+            "name": "repository",
+            "in": "body",
+            "required": true,
+            "schema": {
+              "$ref": "#/definitions/CreateRepoOption"
+            }
           }
         ],
         "responses": {
             "name": "org",
             "in": "path",
             "required": true
+          },
+          {
+            "name": "body",
+            "in": "body",
+            "required": true,
+            "schema": {
+              "$ref": "#/definitions/CreateHookOption"
+            }
           }
         ],
         "responses": {
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the hook to get",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the hook to delete",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the hook to update",
             "name": "id",
             "in": "path",
             "required": true
+          },
+          {
+            "name": "body",
+            "in": "body",
+            "schema": {
+              "$ref": "#/definitions/EditHookOption"
+            }
           }
         ],
         "responses": {
         ],
         "responses": {
           "204": {
-            "description": "user is a member",
-            "schema": {
-              "$ref": "#/responses/empty"
-            }
+            "description": "user is a member"
           },
           "404": {
-            "description": "user is not a member",
-            "schema": {
-              "$ref": "#/responses/empty"
-            }
+            "description": "user is not a member"
           }
         }
       },
         ],
         "responses": {
           "204": {
-            "description": "member removed",
-            "schema": {
-              "$ref": "#/responses/empty"
-            }
+            "description": "member removed"
           }
         }
       }
         ],
         "responses": {
           "204": {
-            "description": "user is a public member",
-            "schema": {
-              "$ref": "#/responses/empty"
-            }
+            "description": "user is a public member"
           },
           "404": {
-            "description": "user is not a public member",
-            "schema": {
-              "$ref": "#/responses/empty"
-            }
+            "description": "user is not a public member"
           }
         }
       },
         ],
         "responses": {
           "204": {
-            "description": "membership publicized",
-            "schema": {
-              "$ref": "#/responses/empty"
-            }
+            "description": "membership publicized"
           }
         }
       },
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "search only for repos that the user with the given id owns or contributes to",
             "name": "uid",
             "in": "query"
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the hook to get",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the hook to delete",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "index of the hook",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the hook to test",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of comment to delete",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the comment to edit",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "index of the issue",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "index of the issue to add tracked time to",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "index of the issue to get",
             "name": "index",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "index of the issue to edit",
             "name": "index",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "index of the issue",
             "name": "index",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "index of the issue",
             "name": "index",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of comment to delete",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the comment to edit",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "index of the issue to create or update a deadline on",
             "name": "index",
             "in": "path",
             "$ref": "#/responses/IssueDeadline"
           },
           "403": {
-            "description": "Not repo writer",
-            "schema": {
-              "$ref": "#/responses/forbidden"
-            }
+            "description": "Not repo writer"
           },
           "404": {
-            "description": "Issue not found",
-            "schema": {
-              "$ref": "#/responses/empty"
-            }
+            "description": "Issue not found"
           }
         }
       }
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "index of the issue",
             "name": "index",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "index of the issue",
             "name": "index",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "index of the issue",
             "name": "index",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "index of the issue",
             "name": "index",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "index of the issue",
             "name": "index",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the label to remove",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the key to get",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the key to delete",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the label to get",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the label to delete",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the label to edit",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the milestone",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the milestone to delete",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the milestone",
             "name": "id",
             "in": "path",
             "name": "repo",
             "in": "path",
             "required": true
+          },
+          {
+            "type": "integer",
+            "description": "Page number",
+            "name": "page",
+            "in": "query"
+          },
+          {
+            "enum": [
+              "closed",
+              "open",
+              "all"
+            ],
+            "type": "string",
+            "description": "State of pull request: open or closed (optional)",
+            "name": "state",
+            "in": "query"
+          },
+          {
+            "enum": [
+              "oldest",
+              "recentupdate",
+              "leastupdate",
+              "mostcomment",
+              "leastcomment",
+              "priority"
+            ],
+            "type": "string",
+            "description": "Type of sort",
+            "name": "sort",
+            "in": "query"
+          },
+          {
+            "type": "integer",
+            "format": "int64",
+            "description": "ID of the milestone",
+            "name": "milestone",
+            "in": "query"
+          },
+          {
+            "type": "array",
+            "items": {
+              "type": "integer",
+              "format": "int64"
+            },
+            "collectionFormat": "multi",
+            "description": "Label IDs",
+            "name": "labels",
+            "in": "query"
           }
         ],
         "responses": {
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "index of the pull request to get",
             "name": "index",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "index of the pull request to edit",
             "name": "index",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "index of the pull request",
             "name": "index",
             "in": "path",
         ],
         "responses": {
           "204": {
-            "description": "pull request has been merged",
-            "schema": {
-              "$ref": "#/responses/empty"
-            }
+            "description": "pull request has been merged"
           },
           "404": {
-            "description": "pull request has not been merged",
-            "schema": {
-              "$ref": "#/responses/empty"
-            }
+            "description": "pull request has not been merged"
           }
         }
       },
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "index of the pull request to merge",
             "name": "index",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the release to get",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the release to delete",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the release to edit",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the release",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the release",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the release",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the attachment to get",
             "name": "attachment_id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the release",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the attachment to delete",
             "name": "attachment_id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the release",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the attachment to edit",
             "name": "attachment_id",
             "in": "path",
         "parameters": [
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the repo to get",
             "name": "id",
             "in": "path",
         "parameters": [
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the team to get",
             "name": "id",
             "in": "path",
         "parameters": [
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the team to delete",
             "name": "id",
             "in": "path",
         ],
         "responses": {
           "204": {
-            "description": "team deleted",
-            "schema": {
-              "$ref": "#/responses/empty"
-            }
+            "description": "team deleted"
           }
         }
       },
         "parameters": [
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the team",
             "name": "id",
             "in": "path",
         "parameters": [
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the team",
             "name": "id",
             "in": "path",
         "parameters": [
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the team",
             "name": "id",
             "in": "path",
         "parameters": [
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the team",
             "name": "id",
             "in": "path",
         "parameters": [
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the team",
             "name": "id",
             "in": "path",
         "parameters": [
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of the team",
             "name": "id",
             "in": "path",
         "parameters": [
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of key to get",
             "name": "id",
             "in": "path",
         "parameters": [
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of key to delete",
             "name": "id",
             "in": "path",
         "parameters": [
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of key to get",
             "name": "id",
             "in": "path",
         "parameters": [
           {
             "type": "integer",
+            "format": "int64",
             "description": "id of key to delete",
             "name": "id",
             "in": "path",
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "ID of the user to search for",
             "name": "uid",
             "in": "query"
             "name": "username",
             "in": "path",
             "required": true
+          },
+          {
+            "name": "accessToken",
+            "in": "body",
+            "schema": {
+              "type": "object",
+              "required": [
+                "name"
+              ],
+              "properties": {
+                "name": {
+                  "type": "string"
+                }
+              }
+            }
           }
         ],
         "responses": {
           },
           {
             "type": "integer",
+            "format": "int64",
             "description": "token to be deleted",
             "name": "token",
             "in": "path",