Skip to content

Commit

Permalink
Update builder.go
Browse files Browse the repository at this point in the history
  • Loading branch information
aeppert authored Apr 21, 2017
1 parent 25284f5 commit 6bbdbfe
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions endpoint/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,19 @@ func Query(name, typ, description string, required bool) Option {
return parameter(p)
}

// FormData defines a formData parameter for the endpoint; name, typ, description, and required correspond to the matching
// swagger fields
func FormData(name, typ, description string, required bool) Option {
p := swagger.Parameter{
Name: name,
In: "formData",
Type: typ,
Description: description,
Required: required,
}
return parameter(p)
}

// Body defines a body parameter for the swagger endpoint as would commonly be used for the POST, PUT, and PATCH methods
// prototype should be a struct or a pointer to struct that swag can use to reflect upon the return type
func Body(prototype interface{}, description string, required bool) Option {
Expand Down

0 comments on commit 6bbdbfe

Please sign in to comment.