proto 生成http grpc swagger

方式一
protoc -I/usr/local/include -I. -Igoogle/api –swagger_out=logtostderr=true:. *.proto



方法二:
go get -u github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2
protoc -I . –openapiv2_out ./swagger/ –openapiv2_opt logtostderr=true *.proto



proto linit and fix



go get -u -v github.com/yoheimuta/protolint/cmd/protolint

protolint lint -fix *.proto


本地查看swager 文档,语法检查
https://github.com/swagger-api/swagger-editor

https://github.com/chain-zhang/pinyin



https://www.cnblogs.com/bergus/articles/protoc-gong-ju-cha-jian-he-sheng-tai.html



https://github.com/uber/prototool



https://github.com/microhq/protoc-gen-micro



https://studygolang.com/articles/12510?fr=sidebar



Category golang