summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/user/repo.go
diff options
context:
space:
mode:
authorAntoine GIRARD <sapk@users.noreply.github.com>2017-05-02 15:35:59 +0200
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2017-05-02 15:35:59 +0200
commit3edb0c58943c003ed3f209b2197d1f43484a3432 (patch)
treee5849cead5053ab505a2c5dc1342111c6bcf0816 /routers/api/v1/user/repo.go
parentbb5f694fc57c3ade9c13e841b9a237f4e192da22 (diff)
downloadgitea-3edb0c58943c003ed3f209b2197d1f43484a3432.tar.gz
gitea-3edb0c58943c003ed3f209b2197d1f43484a3432.zip
Generate swagger json (#1402)
- Generate swagger.json into public/ - Add swagger-ui auto-installation - Add footer link to local swagger-ui - Add /swagger url for using app url. - Fix Swagger-UI version via git tag
Diffstat (limited to 'routers/api/v1/user/repo.go')
-rw-r--r--routers/api/v1/user/repo.go19
1 files changed, 18 insertions, 1 deletions
diff --git a/routers/api/v1/user/repo.go b/routers/api/v1/user/repo.go
index cc08094fc5..ddb932bce9 100644
--- a/routers/api/v1/user/repo.go
+++ b/routers/api/v1/user/repo.go
@@ -36,6 +36,15 @@ func listUserRepos(ctx *context.APIContext, u *models.User) {
// ListUserRepos - list the repos owned and accessible by the given user.
func ListUserRepos(ctx *context.APIContext) {
+ // swagger:route GET /users/{username}/repos userListRepos
+ //
+ // Produces:
+ // - application/json
+ //
+ // Responses:
+ // 200: RepositoryList
+ // 500: error
+
user := GetUserByParams(ctx)
if ctx.Written() {
return
@@ -44,8 +53,16 @@ func ListUserRepos(ctx *context.APIContext) {
}
// ListMyRepos - list the repositories owned by you.
-// see https://github.com/gogits/go-gogs-client/wiki/Repositories#list-your-repositories
func ListMyRepos(ctx *context.APIContext) {
+ // swagger:route GET /user/repos userCurrentListRepos
+ //
+ // Produces:
+ // - application/json
+ //
+ // Responses:
+ // 200: RepositoryList
+ // 500: error
+
listUserRepos(ctx, ctx.User)
}