From 36e7cb975536adc774e854f64a70694ba3a1e87f Mon Sep 17 00:00:00 2001 From: zeripath Date: Fri, 21 Sep 2018 09:56:26 +0100 Subject: [PATCH] Update Swagger API to match the return of /users/search (#4847) Signed-off-by: Andrew Thornton --- routers/api/v1/user/user.go | 11 ++++++++++- templates/swagger/v1_json.tmpl | 16 +++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/routers/api/v1/user/user.go b/routers/api/v1/user/user.go index 49e5f3413..edd5d1b1c 100644 --- a/routers/api/v1/user/user.go +++ b/routers/api/v1/user/user.go @@ -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, diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl index aa44e62c7..18fb34ff4 100644 --- a/templates/swagger/v1_json.tmpl +++ b/templates/swagger/v1_json.tmpl @@ -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" + } + } + } } } }