From a5f63fc4d1a6b65be22efdb68a45873a31a08ae0 Mon Sep 17 00:00:00 2001 From: stevegt Date: Sat, 2 Jun 2018 08:20:28 -0700 Subject: [PATCH] swagger: add 'required: true' for params in URL (#4097) * Partial fix for #4010 Swagger validation needs 'required: true' for parameters that are in the URL path. Signed-off-by: Steve Traugott --- public/swagger.v1.json | 6 ++++-- routers/api/v1/org/org.go | 1 + routers/api/v1/user/watch.go | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/public/swagger.v1.json b/public/swagger.v1.json index 6595d96f005f..2c263ef1f77d 100644 --- a/public/swagger.v1.json +++ b/public/swagger.v1.json @@ -5005,7 +5005,8 @@ "type": "string", "description": "username of user", "name": "username", - "in": "path" + "in": "path", + "required": true } ], "responses": { @@ -5279,7 +5280,8 @@ "type": "string", "description": "username of the user", "name": "username", - "in": "path" + "in": "path", + "required": true } ], "responses": { diff --git a/routers/api/v1/org/org.go b/routers/api/v1/org/org.go index c24a4aeb10d1..29d45d2f2ed6 100644 --- a/routers/api/v1/org/org.go +++ b/routers/api/v1/org/org.go @@ -51,6 +51,7 @@ func ListUserOrgs(ctx *context.APIContext) { // in: path // description: username of user // type: string + // required: true // responses: // "200": // "$ref": "#/responses/OrganizationList" diff --git a/routers/api/v1/user/watch.go b/routers/api/v1/user/watch.go index af7b9b4cca11..2971bf6869c8 100644 --- a/routers/api/v1/user/watch.go +++ b/routers/api/v1/user/watch.go @@ -43,6 +43,7 @@ func GetWatchedRepos(ctx *context.APIContext) { // type: string // in: path // description: username of the user + // required: true // responses: // "200": // "$ref": "#/responses/RepositoryList"