Skip to content

Commit a5f63fc

Browse files
stevegtlafriks
authored andcommitted
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 <[email protected]>
1 parent b8c1dc5 commit a5f63fc

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

public/swagger.v1.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5005,7 +5005,8 @@
50055005
"type": "string",
50065006
"description": "username of user",
50075007
"name": "username",
5008-
"in": "path"
5008+
"in": "path",
5009+
"required": true
50095010
}
50105011
],
50115012
"responses": {
@@ -5279,7 +5280,8 @@
52795280
"type": "string",
52805281
"description": "username of the user",
52815282
"name": "username",
5282-
"in": "path"
5283+
"in": "path",
5284+
"required": true
52835285
}
52845286
],
52855287
"responses": {

routers/api/v1/org/org.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ func ListUserOrgs(ctx *context.APIContext) {
5151
// in: path
5252
// description: username of user
5353
// type: string
54+
// required: true
5455
// responses:
5556
// "200":
5657
// "$ref": "#/responses/OrganizationList"

routers/api/v1/user/watch.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func GetWatchedRepos(ctx *context.APIContext) {
4343
// type: string
4444
// in: path
4545
// description: username of the user
46+
// required: true
4647
// responses:
4748
// "200":
4849
// "$ref": "#/responses/RepositoryList"

0 commit comments

Comments
 (0)