diff options
author | Jonas Östanbäck <cez81@users.noreply.github.com> | 2017-06-12 02:59:51 +0200 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-06-12 08:59:51 +0800 |
commit | ad70af124853ab8046a865bfc098dbd426a0d1a7 (patch) | |
tree | db6676c3e083db3d304d7e15abe28aaf99f6ba19 /routers | |
parent | 91f27bf9bd942ccf8ec78c2d735fc2ac48493d67 (diff) | |
download | gitea-ad70af124853ab8046a865bfc098dbd426a0d1a7.tar.gz gitea-ad70af124853ab8046a865bfc098dbd426a0d1a7.zip |
Add repo fork swagger (#1941)
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/repo/fork.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/routers/api/v1/repo/fork.go b/routers/api/v1/repo/fork.go index 9c6da754ef..c743aec301 100644 --- a/routers/api/v1/repo/fork.go +++ b/routers/api/v1/repo/fork.go @@ -13,6 +13,15 @@ import ( // ListForks list a repository's forks func ListForks(ctx *context.APIContext) { + // swagger:route GET /repos/{owner}/{repo}/forks listForks + // + // Produces: + // - application/json + // + // Responses: + // 200: RepositoryList + // 500: error + forks, err := ctx.Repo.Repository.GetForks() if err != nil { ctx.Error(500, "GetForks", err) @@ -32,6 +41,17 @@ func ListForks(ctx *context.APIContext) { // CreateFork create a fork of a repo func CreateFork(ctx *context.APIContext, form api.CreateForkOption) { + // swagger:route POST /repos/{owner}/{repo}/forks createFork + // + // Produces: + // - application/json + // + // Responses: + // 202: Repository + // 403: forbidden + // 422: validationError + // 500: error + repo := ctx.Repo.Repository var forker *models.User // user/org that will own the fork if form.Organization == nil { |