Skip to content

Commit 36e7cb9

Browse files
zeripathlunny
authored andcommitted
Update Swagger API to match the return of /users/search (#4847)
Signed-off-by: Andrew Thornton <art27@cantab.net>
1 parent dab02b8 commit 36e7cb9

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

routers/api/v1/user/user.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,16 @@ func Search(ctx *context.APIContext) {
3333
// type: integer
3434
// responses:
3535
// "200":
36-
// "$ref": "#/responses/UserList"
36+
// description: "SearchResults of a successful search"
37+
// schema:
38+
// type: object
39+
// properties:
40+
// ok:
41+
// type: boolean
42+
// data:
43+
// type: array
44+
// items:
45+
// "$ref": "#/definitions/User"
3746
opts := &models.SearchUserOptions{
3847
Keyword: strings.Trim(ctx.Query("q"), " "),
3948
Type: models.UserTypeIndividual,

templates/swagger/v1_json.tmpl

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5212,7 +5212,21 @@
52125212
],
52135213
"responses": {
52145214
"200": {
5215-
"$ref": "#/responses/UserList"
5215+
"description": "SearchResults of a successful search",
5216+
"schema": {
5217+
"type": "object",
5218+
"properties": {
5219+
"data": {
5220+
"type": "array",
5221+
"items": {
5222+
"$ref": "#/definitions/User"
5223+
}
5224+
},
5225+
"ok": {
5226+
"type": "boolean"
5227+
}
5228+
}
5229+
}
52165230
}
52175231
}
52185232
}

0 commit comments

Comments
 (0)