File tree 4 files changed +27
-31
lines changed
4 files changed +27
-31
lines changed Original file line number Diff line number Diff line change @@ -14,3 +14,10 @@ type swaggerResponseOAuth2Application struct {
14
14
// in:body
15
15
Body api.OAuth2Application `json:"body"`
16
16
}
17
+
18
+ // AccessToken represents an API access token.
19
+ // swagger:response AccessToken
20
+ type swaggerResponseAccessToken struct {
21
+ // in:body
22
+ Body api.AccessToken `json:"body"`
23
+ }
Original file line number Diff line number Diff line change @@ -164,6 +164,9 @@ type swaggerParameterBodies struct {
164
164
// in:body
165
165
CreateTagOption api.CreateTagOption
166
166
167
+ // in:body
168
+ CreateAccessTokenOption api.CreateAccessTokenOption
169
+
167
170
// in:body
168
171
UserSettingsOptions api.UserSettingsOptions
169
172
}
Original file line number Diff line number Diff line change @@ -76,15 +76,10 @@ func CreateAccessToken(ctx *context.APIContext) {
76
76
// description: username of user
77
77
// type: string
78
78
// required: true
79
- // - name: accessToken
79
+ // - name: userCreateToken
80
80
// in: body
81
81
// schema:
82
- // type: object
83
- // required:
84
- // - name
85
- // properties:
86
- // name:
87
- // type: string
82
+ // "$ref": "#/definitions/CreateAccessTokenOption"
88
83
// responses:
89
84
// "201":
90
85
// "$ref": "#/responses/AccessToken"
Original file line number Diff line number Diff line change @@ -11917,18 +11917,10 @@
11917
11917
"required": true
11918
11918
},
11919
11919
{
11920
- "name": "accessToken ",
11920
+ "name": "userCreateToken ",
11921
11921
"in": "body",
11922
11922
"schema": {
11923
- "type": "object",
11924
- "required": [
11925
- "name"
11926
- ],
11927
- "properties": {
11928
- "name": {
11929
- "type": "string"
11930
- }
11931
- }
11923
+ "$ref": "#/definitions/CreateAccessTokenOption"
11932
11924
}
11933
11925
}
11934
11926
],
12654
12646
},
12655
12647
"x-go-package": "code.gitea.io/gitea/modules/structs"
12656
12648
},
12649
+ "CreateAccessTokenOption": {
12650
+ "description": "CreateAccessTokenOption options when create access token",
12651
+ "type": "object",
12652
+ "properties": {
12653
+ "name": {
12654
+ "type": "string",
12655
+ "x-go-name": "Name"
12656
+ }
12657
+ },
12658
+ "x-go-package": "code.gitea.io/gitea/modules/structs"
12659
+ },
12657
12660
"CreateBranchProtectionOption": {
12658
12661
"description": "CreateBranchProtectionOption options for creating a branch protection",
12659
12662
"type": "object",
17044
17047
"responses": {
17045
17048
"AccessToken": {
17046
17049
"description": "AccessToken represents an API access token.",
17047
- "headers": {
17048
- "id": {
17049
- "type": "integer",
17050
- "format": "int64"
17051
- },
17052
- "name": {
17053
- "type": "string"
17054
- },
17055
- "sha1": {
17056
- "type": "string"
17057
- },
17058
- "token_last_eight": {
17059
- "type": "string"
17060
- }
17050
+ "schema": {
17051
+ "$ref": "#/definitions/AccessToken"
17061
17052
}
17062
17053
},
17063
17054
"AccessTokenList": {
You can’t perform that action at this time.
0 commit comments