Пример #1
0
		a.Description("Delete work item with given id.")
		a.Params(func() {
			a.Param("commentId", d.UUID, "commentId")
		})
		a.Response(d.OK)
		a.Response(d.BadRequest, JSONAPIErrors)
		a.Response(d.InternalServerError, JSONAPIErrors)
		a.Response(d.NotFound, JSONAPIErrors)
		a.Response(d.Unauthorized, JSONAPIErrors)
		a.Response(d.Forbidden, JSONAPIErrors)
	})

})

var _ = a.Resource("work-item-comments", func() {
	a.Parent("workitem")

	a.Action("list", func() {
		a.Routing(
			a.GET("comments"),
		)
		a.Description("List comments associated with the given work item")
		a.Params(func() {
			a.Param("page[offset]", d.String, `Paging start position is a string pointing to
			the beginning of pagination.  The value starts from 0 onwards.`)
			a.Param("page[limit]", d.Integer, `Paging size is the number of items in a page`)
		})
		a.Response(d.OK, func() {
			a.Media(commentArray)
		})
		a.Response(d.BadRequest, JSONAPIErrors)
Пример #2
0
			a.Param("iterationID", d.String, "Iteration Identifier")
		})
		a.Payload(iterationSingle)
		a.Response(d.OK, func() {
			a.Media(iterationSingle)
		})
		a.Response(d.BadRequest, JSONAPIErrors)
		a.Response(d.InternalServerError, JSONAPIErrors)
		a.Response(d.NotFound, JSONAPIErrors)
		a.Response(d.Unauthorized, JSONAPIErrors)
	})
})

// new version of "list" for migration
var _ = a.Resource("space-iterations", func() {
	a.Parent("space")

	a.Action("list", func() {
		a.Routing(
			a.GET("iterations"),
		)
		a.Description("List iterations.")
		/*
			a.Params(func() {
				a.Param("filter", d.String, "a query language expression restricting the set of found work items")
				a.Param("page[offset]", d.String, "Paging start position")
				a.Param("page[limit]", d.Integer, "Paging size")
			})
		*/
		a.Response(d.OK, func() {
			a.Media(iterationList)