Skip to content

Commit 6341130

Browse files
a1012112796techknowlogick6543
authored
add some reponse status on api docs (#15399)
Signed-off-by: a1012112796 <[email protected]> Co-authored-by: techknowlogick <[email protected]> Co-authored-by: 6543 <[email protected]>
1 parent 18efe9a commit 6341130

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

routers/api/v1/user/app.go

+12
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ func CreateAccessToken(ctx *context.APIContext) {
8888
// responses:
8989
// "201":
9090
// "$ref": "#/responses/AccessToken"
91+
// "400":
92+
// "$ref": "#/responses/error"
9193

9294
form := web.GetForm(ctx).(*api.CreateAccessTokenOption)
9395

@@ -139,6 +141,8 @@ func DeleteAccessToken(ctx *context.APIContext) {
139141
// responses:
140142
// "204":
141143
// "$ref": "#/responses/empty"
144+
// "404":
145+
// "$ref": "#/responses/notFound"
142146
// "422":
143147
// "$ref": "#/responses/error"
144148

@@ -199,6 +203,8 @@ func CreateOauth2Application(ctx *context.APIContext) {
199203
// responses:
200204
// "201":
201205
// "$ref": "#/responses/OAuth2Application"
206+
// "400":
207+
// "$ref": "#/responses/error"
202208

203209
data := web.GetForm(ctx).(*api.CreateOAuth2ApplicationOptions)
204210

@@ -272,6 +278,8 @@ func DeleteOauth2Application(ctx *context.APIContext) {
272278
// responses:
273279
// "204":
274280
// "$ref": "#/responses/empty"
281+
// "404":
282+
// "$ref": "#/responses/notFound"
275283
appID := ctx.ParamsInt64(":id")
276284
if err := models.DeleteOAuth2Application(appID, ctx.User.ID); err != nil {
277285
if models.IsErrOAuthApplicationNotFound(err) {
@@ -302,6 +310,8 @@ func GetOauth2Application(ctx *context.APIContext) {
302310
// responses:
303311
// "200":
304312
// "$ref": "#/responses/OAuth2Application"
313+
// "404":
314+
// "$ref": "#/responses/notFound"
305315
appID := ctx.ParamsInt64(":id")
306316
app, err := models.GetOAuth2ApplicationByID(appID)
307317
if err != nil {
@@ -340,6 +350,8 @@ func UpdateOauth2Application(ctx *context.APIContext) {
340350
// responses:
341351
// "200":
342352
// "$ref": "#/responses/OAuth2Application"
353+
// "404":
354+
// "$ref": "#/responses/notFound"
343355
appID := ctx.ParamsInt64(":id")
344356

345357
data := web.GetForm(ctx).(*api.CreateOAuth2ApplicationOptions)

templates/swagger/v1_json.tmpl

+18
Original file line numberDiff line numberDiff line change
@@ -10068,6 +10068,9 @@
1006810068
"responses": {
1006910069
"201": {
1007010070
"$ref": "#/responses/OAuth2Application"
10071+
},
10072+
"400": {
10073+
"$ref": "#/responses/error"
1007110074
}
1007210075
}
1007310076
}
@@ -10095,6 +10098,9 @@
1009510098
"responses": {
1009610099
"200": {
1009710100
"$ref": "#/responses/OAuth2Application"
10101+
},
10102+
"404": {
10103+
"$ref": "#/responses/notFound"
1009810104
}
1009910105
}
1010010106
},
@@ -10120,6 +10126,9 @@
1012010126
"responses": {
1012110127
"204": {
1012210128
"$ref": "#/responses/empty"
10129+
},
10130+
"404": {
10131+
"$ref": "#/responses/notFound"
1012310132
}
1012410133
}
1012510134
},
@@ -10153,6 +10162,9 @@
1015310162
"responses": {
1015410163
"200": {
1015510164
"$ref": "#/responses/OAuth2Application"
10165+
},
10166+
"404": {
10167+
"$ref": "#/responses/notFound"
1015610168
}
1015710169
}
1015810170
}
@@ -11492,6 +11504,9 @@
1149211504
"responses": {
1149311505
"201": {
1149411506
"$ref": "#/responses/AccessToken"
11507+
},
11508+
"400": {
11509+
"$ref": "#/responses/error"
1149511510
}
1149611511
}
1149711512
}
@@ -11526,6 +11541,9 @@
1152611541
"204": {
1152711542
"$ref": "#/responses/empty"
1152811543
},
11544+
"404": {
11545+
"$ref": "#/responses/notFound"
11546+
},
1152911547
"422": {
1153011548
"$ref": "#/responses/error"
1153111549
}

0 commit comments

Comments
 (0)