summaryrefslogtreecommitdiffstats
path: root/vendor/code.gitea.io/sdk/gitea/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 /vendor/code.gitea.io/sdk/gitea/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 'vendor/code.gitea.io/sdk/gitea/repo.go')
-rw-r--r--vendor/code.gitea.io/sdk/gitea/repo.go40
1 files changed, 34 insertions, 6 deletions
diff --git a/vendor/code.gitea.io/sdk/gitea/repo.go b/vendor/code.gitea.io/sdk/gitea/repo.go
index 9399ca2ee3..acacb0ec44 100644
--- a/vendor/code.gitea.io/sdk/gitea/repo.go
+++ b/vendor/code.gitea.io/sdk/gitea/repo.go
@@ -19,6 +19,7 @@ type Permission struct {
}
// Repository represents a API repository.
+// swagger:response Repository
type Repository struct {
ID int64 `json:"id"`
Owner *User `json:"owner"`
@@ -42,6 +43,10 @@ type Repository struct {
Permissions *Permission `json:"permissions,omitempty"`
}
+// RepositoryList represents a list of API repository.
+// swagger:response RepositoryList
+type RepositoryList []*Repository
+
// ListMyRepos lists all repositories for the authenticated user that has access to.
func (c *Client) ListMyRepos() ([]*Repository, error) {
repos := make([]*Repository, 0, 10)
@@ -61,14 +66,37 @@ func (c *Client) ListOrgRepos(org string) ([]*Repository, error) {
}
// CreateRepoOption options when creating repository
+//swagger:parameters createOrgRepo
type CreateRepoOption struct {
- Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(100)"`
+ // Name of the repository to create
+ //
+ // in: body
+ // unique: true
+ Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(100)"`
+ // Description of the repository to create
+ //
+ // in: body
Description string `json:"description" binding:"MaxSize(255)"`
- Private bool `json:"private"`
- AutoInit bool `json:"auto_init"`
- Gitignores string `json:"gitignores"`
- License string `json:"license"`
- Readme string `json:"readme"`
+ // Is the repository to create private ?
+ //
+ // in: body
+ Private bool `json:"private"`
+ // Init the repository to create ?
+ //
+ // in: body
+ AutoInit bool `json:"auto_init"`
+ // Gitignores to use
+ //
+ // in: body
+ Gitignores string `json:"gitignores"`
+ // License to use
+ //
+ // in: body
+ License string `json:"license"`
+ // Readme of the repository to create
+ //
+ // in: body
+ Readme string `json:"readme"`
}
// CreateRepo creates a repository for authenticated user.