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 1663
1663
}
1664
1664
}
1665
1665
},
1666
+ "/repos/{owner}/{repo}/git/trees/{sha}": {
1667
+ "get": {
1668
+ "produces": [
1669
+ "application/json"
1670
+ ],
1671
+ "tags": [
1672
+ "repository"
1673
+ ],
1674
+ "summary": "Gets the tree of a repository.",
1675
+ "operationId": "GetTree",
1676
+ "parameters": [
1677
+ {
1678
+ "type": "string",
1679
+ "description": "owner of the repo",
1680
+ "name": "owner",
1681
+ "in": "path",
1682
+ "required": true
1683
+ },
1684
+ {
1685
+ "type": "string",
1686
+ "description": "name of the repo",
1687
+ "name": "repo",
1688
+ "in": "path",
1689
+ "required": true
1690
+ },
1691
+ {
1692
+ "type": "string",
1693
+ "description": "sha of the commit",
1694
+ "name": "sha",
1695
+ "in": "path",
1696
+ "required": true
1697
+ }
1698
+ ],
1699
+ "responses": {
1700
+ "200": {
1701
+ "$ref": "#/responses/GitTreeResponse"
1702
+ }
1703
+ }
1704
+ }
1705
+ },
1666
1706
"/repos/{owner}/{repo}/hooks": {
1667
1707
"get": {
1668
1708
"produces": [
7040
7080
},
7041
7081
"x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
7042
7082
},
7083
+ "GitEntry": {
7084
+ "description": "GitEntry represents a git tree",
7085
+ "type": "object",
7086
+ "properties": {
7087
+ "mode": {
7088
+ "type": "string",
7089
+ "x-go-name": "Mode"
7090
+ },
7091
+ "path": {
7092
+ "type": "string",
7093
+ "x-go-name": "Path"
7094
+ },
7095
+ "sha": {
7096
+ "type": "string",
7097
+ "x-go-name": "SHA"
7098
+ },
7099
+ "size": {
7100
+ "type": "integer",
7101
+ "format": "int64",
7102
+ "x-go-name": "Size"
7103
+ },
7104
+ "type": {
7105
+ "type": "string",
7106
+ "x-go-name": "Type"
7107
+ },
7108
+ "url": {
7109
+ "type": "string",
7110
+ "x-go-name": "URL"
7111
+ }
7112
+ },
7113
+ "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
7114
+ },
7043
7115
"GitObject": {
7044
7116
"type": "object",
7045
7117
"title": "GitObject represents a Git object.",
7059
7131
},
7060
7132
"x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
7061
7133
},
7134
+ "GitTreeResponse": {
7135
+ "description": "GitTreeResponse returns a git tree",
7136
+ "type": "object",
7137
+ "properties": {
7138
+ "sha": {
7139
+ "type": "string",
7140
+ "x-go-name": "SHA"
7141
+ },
7142
+ "tree": {
7143
+ "type": "array",
7144
+ "items": {
7145
+ "$ref": "#/definitions/GitEntry"
7146
+ },
7147
+ "x-go-name": "Entries"
7148
+ },
7149
+ "truncated": {
7150
+ "type": "boolean",
7151
+ "x-go-name": "Truncated"
7152
+ },
7153
+ "url": {
7154
+ "type": "string",
7155
+ "x-go-name": "URL"
7156
+ }
7157
+ },
7158
+ "x-go-package": "code.gitea.io/gitea/vendor/code.gitea.io/sdk/gitea"
7159
+ },
7062
7160
"Issue": {
7063
7161
"description": "Issue represents an issue in a repository",
7064
7162
"type": "object",
8200
8298
}
8201
8299
}
8202
8300
},
8301
+ "GitTreeResponse": {
8302
+ "description": "GitTreeResponse",
8303
+ "schema": {
8304
+ "$ref": "#/definitions/GitTreeResponse"
8305
+ }
8306
+ },
8203
8307
"Hook": {
8204
8308
"description": "Hook",
8205
8309
"schema": {
You can’t perform that action at this time.
0 commit comments