Skip to content

Commit

Permalink
Add basic support for lists (multiple query values)
Browse files Browse the repository at this point in the history
  • Loading branch information
miketonks committed Sep 4, 2018
1 parent 5a324fd commit 1469e0c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion swag-validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,13 @@ func SwaggerValidator(api *swagger.API) gin.HandlerFunc {
valueFormat = f.(string)
}
}
document[k] = coerce(v[0], valueType, valueFormat)
// if parameter has multiple values, pass it as array
// for now we only support array of strings
if len(v) > 1 {
document[k] = v
} else {
document[k] = coerce(v[0], valueType, valueFormat)
}
}

// For muiltipart form, handle params and file uploads
Expand Down

0 comments on commit 1469e0c

Please sign in to comment.