Skip to content

Commit

Permalink
feat: support header parameters
Browse files Browse the repository at this point in the history
Adding the custom header in Param
  • Loading branch information
easonlin404 authored Jan 17, 2018
2 parents 921397a + 59aa7e5 commit 47f8a25
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (operation *Operation) ParseParamComment(commentLine string) error {

//five possible parameter types.
switch paramType {
case "query", "path":
case "query", "path", "header":
param = createParameter(paramType, description, name, schemaType, required)
case "body":
param = createParameter(paramType, description, name, "object", required) // TODO: if Parameter types can be objects, but also primitives and arrays
Expand All @@ -132,9 +132,9 @@ func (operation *Operation) ParseParamComment(commentLine string) error {
// panic("not supported Header paramType yet.")
//case "Form":
// panic("not supported Form paramType yet.")
// enable multipart/form-data upload file
case "formData" :
param = createParameter(paramType, description, name, "file", required)
// enable multipart/form-data upload file
case "formData":
param = createParameter(paramType, description, name, "file", required)
}
operation.Operation.Parameters = append(operation.Operation.Parameters, param)
}
Expand Down

0 comments on commit 47f8a25

Please sign in to comment.