File tree Expand file tree Collapse file tree 3 files changed +135
-0
lines changed Expand file tree Collapse file tree 3 files changed +135
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,30 @@ import (
16
16
17
17
// GetTree get the tree of a repository.
18
18
func GetTree (ctx * context.APIContext ) {
19
+ // swagger:operation GET /repos/{owner}/{repo}/git/trees/{sha} repository GetTree
20
+ // ---
21
+ // summary: Gets the tree of a repository.
22
+ // produces:
23
+ // - application/json
24
+ // parameters:
25
+ // - name: owner
26
+ // in: path
27
+ // description: owner of the repo
28
+ // type: string
29
+ // required: true
30
+ // - name: repo
31
+ // in: path
32
+ // description: name of the repo
33
+ // type: string
34
+ // required: true
35
+ // - name: sha
36
+ // in: path
37
+ // description: sha of the commit
38
+ // type: string
39
+ // required: true
40
+ // responses:
41
+ // "200":
42
+ // "$ref": "#/responses/GitTreeResponse"
19
43
sha := ctx .Params ("sha" )
20
44
if len (sha ) == 0 {
21
45
ctx .Error (400 , "sha not provided" , nil )
Original file line number Diff line number Diff line change @@ -133,3 +133,10 @@ type swaggerResponseAttachment struct {
133
133
//in: body
134
134
Body api.Attachment `json:"body"`
135
135
}
136
+
137
+ // GitTreeResponse
138
+ // swagger:response GitTreeResponse
139
+ type swaggerGitTreeResponse struct {
140
+ //in: body
141
+ Body api.GitTreeResponse `json:"body"`
142
+ }
Original file line number Diff line number Diff line change 1701
1701
}
1702
1702
}
1703
1703
},
1704
+ "/repos/{owner}/{repo}/git/trees/{sha}": {
1705
+ "get": {
1706
+ "produces": [
1707
+ "application/json"
1708
+ ],
1709
+ "tags": [
1710
+ "repository"
1711
+ ],
1712
+ "summary": "Gets the tree of a repository.",
1713
+ "operationId": "GetTree",
1714
+ "parameters": [
1715
+ {
1716
+ "type": "string",
1717
+ "description": "owner of the repo",
1718
+ "name": "owner",
1719
+ "in": "path",
1720
+ "required": true
1721
+ },
1722
+ {
1723
+ "type": "string",
1724
+ "description": "name of the repo",
1725
+ "name": "repo",
1726
+ "in": "path",
1727
+ "required": true
1728
+ },
1729
+ {
1730
+ "type": "string",
1731
+ "description": "sha of the commit",
1732
+ "name": "sha",
1733
+ "in": "path",
1734
+ "required": true
1735
+ }
1736
+ ],
1737
+ "responses": {
1738
+ "200": {
1739
+ "$ref": "#/responses/GitTreeResponse"
1740
+ }
1741
+ }
1742
+ }
1743
+ },
1704
1744
"/repos/{owner}/{repo}/hooks": {
1705
1745
"get": {
1706
1746
"produces": [
7127
7167
},
7128
7168
"x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
7129
7169
},
7170
+ "GitEntry": {
7171
+ "description": "GitEntry represents a git tree",
7172
+ "type": "object",
7173
+ "properties": {
7174
+ "mode": {
7175
+ "type": "string",
7176
+ "x-go-name": "Mode"
7177
+ },
7178
+ "path": {
7179
+ "type": "string",
7180
+ "x-go-name": "Path"
7181
+ },
7182
+ "sha": {
7183
+ "type": "string",
7184
+ "x-go-name": "SHA"
7185
+ },
7186
+ "size": {
7187
+ "type": "integer",
7188
+ "format": "int64",
7189
+ "x-go-name": "Size"
7190
+ },
7191
+ "type": {
7192
+ "type": "string",
7193
+ "x-go-name": "Type"
7194
+ },
7195
+ "url": {
7196
+ "type": "string",
7197
+ "x-go-name": "URL"
7198
+ }
7199
+ },
7200
+ "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
7201
+ },
7130
7202
"GitObject": {
7131
7203
"type": "object",
7132
7204
"title": "GitObject represents a Git object.",
7146
7218
},
7147
7219
"x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
7148
7220
},
7221
+ "GitTreeResponse": {
7222
+ "description": "GitTreeResponse returns a git tree",
7223
+ "type": "object",
7224
+ "properties": {
7225
+ "sha": {
7226
+ "type": "string",
7227
+ "x-go-name": "SHA"
7228
+ },
7229
+ "tree": {
7230
+ "type": "array",
7231
+ "items": {
7232
+ "$ref": "#/definitions/GitEntry"
7233
+ },
7234
+ "x-go-name": "Entries"
7235
+ },
7236
+ "truncated": {
7237
+ "type": "boolean",
7238
+ "x-go-name": "Truncated"
7239
+ },
7240
+ "url": {
7241
+ "type": "string",
7242
+ "x-go-name": "URL"
7243
+ }
7244
+ },
7245
+ "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
7246
+ },
7149
7247
"Issue": {
7150
7248
"description": "Issue represents an issue in a repository",
7151
7249
"type": "object",
8290
8388
}
8291
8389
}
8292
8390
},
8391
+ "GitTreeResponse": {
8392
+ "description": "GitTreeResponse",
8393
+ "schema": {
8394
+ "$ref": "#/definitions/GitTreeResponse"
8395
+ }
8396
+ },
8293
8397
"Hook": {
8294
8398
"description": "Hook",
8295
8399
"schema": {
You can’t perform that action at this time.
0 commit comments