Browse Source

Update Swagger API to match the return of /users/search (#4847)

Signed-off-by: Andrew Thornton <art27@cantab.net>
for-closed-social
zeripath 5 years ago
committed by Lunny Xiao
parent
commit
36e7cb9755
2 changed files with 25 additions and 2 deletions
  1. +10
    -1
      routers/api/v1/user/user.go
  2. +15
    -1
      templates/swagger/v1_json.tmpl

+ 10
- 1
routers/api/v1/user/user.go View File

@ -33,7 +33,16 @@ func Search(ctx *context.APIContext) {
// type: integer
// responses:
// "200":
// "$ref": "#/responses/UserList"
// description: "SearchResults of a successful search"
// schema:
// type: object
// properties:
// ok:
// type: boolean
// data:
// type: array
// items:
// "$ref": "#/definitions/User"
opts := &models.SearchUserOptions{
Keyword: strings.Trim(ctx.Query("q"), " "),
Type: models.UserTypeIndividual,

+ 15
- 1
templates/swagger/v1_json.tmpl View File

@ -5212,7 +5212,21 @@
],
"responses": {
"200": {
"$ref": "#/responses/UserList"
"description": "SearchResults of a successful search",
"schema": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/User"
}
},
"ok": {
"type": "boolean"
}
}
}
}
}
}

Loading…
Cancel
Save