Skip to content

Commit

Permalink
Update Swagger API to match the return of /users/search (go-gitea#4847)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath authored and lunny committed Sep 21, 2018
1 parent dab02b8 commit 36e7cb9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
11 changes: 10 additions & 1 deletion routers/api/v1/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
16 changes: 15 additions & 1 deletion templates/swagger/v1_json.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
}
}
}
Expand Down

0 comments on commit 36e7cb9

Please sign in to comment.