Skip to content

Commit

Permalink
adds opts.Tags to operationObject.Tags
Browse files Browse the repository at this point in the history
this is a continuation of work in grpc-ecosystem#145, which left as a TODO to check
remaining options fields for the operationObject during swagger generation.
This PR causes protoc-gen-swagger to check if opts.Tags exists and
overwrite the default value if it does exist.
  • Loading branch information
thurt committed Jan 15, 2018
1 parent 7542c76 commit 3c0b6da
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions protoc-gen-swagger/genswagger/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -635,9 +635,14 @@ func renderServices(services []*descriptor.Service, paths swaggerPathsObject, re
operationObject.ExternalDocs.URL = opts.ExternalDocs.Url
}
}

// TODO(ivucica): this would be better supported by looking whether the method is deprecated in the proto file
operationObject.Deprecated = opts.Deprecated

if opts.Tags != nil {
operationObject.Tags = opts.Tags
}

// TODO(ivucica): add remaining fields of operation object
}

Expand Down

0 comments on commit 3c0b6da

Please sign in to comment.