Skip to content

Commit

Permalink
protoc-gen-swagger/genswagger: add PATCH support (#228, #268)
Browse files Browse the repository at this point in the history
Fixes: #211
  • Loading branch information
tmc authored and yugui committed Nov 28, 2016
1 parent ded242e commit 96459c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions protoc-gen-swagger/genswagger/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,9 @@ func renderServices(services []*descriptor.Service, paths swaggerPathsObject, re
case "PUT":
pathItemObject.Put = operationObject
break
case "PATCH":
pathItemObject.Patch = operationObject
break
}
paths[templateToSwaggerPath(b.PathTmpl.Template)] = pathItemObject
}
Expand Down
1 change: 1 addition & 0 deletions protoc-gen-swagger/genswagger/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ type swaggerPathItemObject struct {
Delete *swaggerOperationObject `json:"delete,omitempty"`
Post *swaggerOperationObject `json:"post,omitempty"`
Put *swaggerOperationObject `json:"put,omitempty"`
Patch *swaggerOperationObject `json:"patch,omitempty"`
}

// http://swagger.io/specification/#operationObject
Expand Down

0 comments on commit 96459c7

Please sign in to comment.