diff options
Diffstat (limited to 'routers/api/v1/repo/milestone.go')
-rw-r--r-- | routers/api/v1/repo/milestone.go | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/routers/api/v1/repo/milestone.go b/routers/api/v1/repo/milestone.go index 3953b0c3c0..a138cb7a69 100644 --- a/routers/api/v1/repo/milestone.go +++ b/routers/api/v1/repo/milestone.go @@ -16,14 +16,25 @@ import ( // ListMilestones list all the milestones for a repository func ListMilestones(ctx *context.APIContext) { - // swagger:operation GET /repos/{owner}/{repo}/milestones/{id} issue issueGetMilestone + // swagger:operation GET /repos/{owner}/{repo}/milestones issue issueGetMilestonesList // --- - // summary: Get a milestone + // summary: Get all of a repository's milestones // produces: // - application/json + // parameters: + // - name: owner + // in: path + // description: owner of the repo + // type: string + // required: true + // - name: repo + // in: path + // description: name of the repo + // type: string + // required: true // responses: // "200": - // "$ref": "#/responses/Milestone" + // "$ref": "#/responses/MilestoneList" milestones, err := models.GetMilestonesByRepoID(ctx.Repo.Repository.ID) if err != nil { ctx.Error(500, "GetMilestonesByRepoID", err) @@ -39,9 +50,9 @@ func ListMilestones(ctx *context.APIContext) { // GetMilestone get a milestone for a repository func GetMilestone(ctx *context.APIContext) { - // swagger:operation GET /repos/{owner}/{repo}/milestones issue issueGetMilestones + // swagger:operation GET /repos/{owner}/{repo}/milestones/{id} issue issueGetMilestone // --- - // summary: Get all of a repository's milestones + // summary: Get a milestone // produces: // - application/json // parameters: @@ -55,25 +66,14 @@ func GetMilestone(ctx *context.APIContext) { // description: name of the repo // type: string // required: true - // parameters: - // - name: owner - // in: path - // description: owner of the repo - // type: string - // required: true - // - name: repo - // in: path - // description: name of the repo - // type: string - // required: true // - name: id // in: path - // description: id of the milestone to get + // description: id of the milestone // type: integer // required: true // responses: // "200": - // "$ref": "#/responses/MilestoneList" + // "$ref": "#/responses/Milestone" milestone, err := models.GetMilestoneByRepoID(ctx.Repo.Repository.ID, ctx.ParamsInt64(":id")) if err != nil { if models.IsErrMilestoneNotExist(err) { @@ -152,6 +152,11 @@ func EditMilestone(ctx *context.APIContext, form api.EditMilestoneOption) { // description: name of the repo // type: string // required: true + // - name: id + // in: path + // description: id of the milestone + // type: integer + // required: true // - name: body // in: body // schema: @@ -202,7 +207,7 @@ func DeleteMilestone(ctx *context.APIContext) { // description: name of the repo // type: string // required: true - // - name: body + // - name: id // in: path // description: id of the milestone to delete // type: integer |