]> source.dussan.org Git - gitea.git/commitdiff
Update Swagger API to match the return of /users/search (#4847)
authorzeripath <art27@cantab.net>
Fri, 21 Sep 2018 08:56:26 +0000 (09:56 +0100)
committerLunny Xiao <xiaolunwen@gmail.com>
Fri, 21 Sep 2018 08:56:26 +0000 (16:56 +0800)
Signed-off-by: Andrew Thornton <art27@cantab.net>
routers/api/v1/user/user.go
templates/swagger/v1_json.tmpl

index 49e5f3413644b04f81df83d41b5dff26ca9dc819..edd5d1b1cbb91d46bbbed7ff29b635b6bc46845f 100644 (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,
index aa44e62c7223517a50c93d7ae405b85888f19ef5..18fb34ff4525eeaf99ccf702d885b661e9567af9 100644 (file)
         ],
         "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"
+                }
+              }
+            }
           }
         }
       }