Skip to content

Commit

Permalink
swagger: add 'required: true' for params in URL (go-gitea#4097)
Browse files Browse the repository at this point in the history
* Partial fix for go-gitea#4010

Swagger validation needs 'required: true' for parameters that are in
the URL path.

Signed-off-by: Steve Traugott <stevegt@t7a.org>
  • Loading branch information
stevegt authored and lafriks committed Jun 2, 2018
1 parent b8c1dc5 commit a5f63fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions public/swagger.v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -5005,7 +5005,8 @@
"type": "string",
"description": "username of user",
"name": "username",
"in": "path"
"in": "path",
"required": true
}
],
"responses": {
Expand Down Expand Up @@ -5279,7 +5280,8 @@
"type": "string",
"description": "username of the user",
"name": "username",
"in": "path"
"in": "path",
"required": true
}
],
"responses": {
Expand Down
1 change: 1 addition & 0 deletions routers/api/v1/org/org.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func ListUserOrgs(ctx *context.APIContext) {
// in: path
// description: username of user
// type: string
// required: true
// responses:
// "200":
// "$ref": "#/responses/OrganizationList"
Expand Down
1 change: 1 addition & 0 deletions routers/api/v1/user/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a5f63fc

Please sign in to comment.