0

How do i convert protoc command to prototool.yaml file ?

protoc --proto_path=api/proto/v1 --proto_path=third_party --go_out=plugins=grpc:pkg/api/v1 todo-service.proto
protoc --proto_path=api/proto/v1 --proto_path=third_party --grpc-gateway_out=logtostderr=true:pkg/api/v1 todo-service.proto
protoc --proto_path=api/proto/v1 --proto_path=third_party --swagger_out=logtostderr=true:api/swagger/v1 todo-service.proto
user1844634
  • 1,221
  • 2
  • 17
  • 35

1 Answers1

0

with the old swagger name in the grpc-gateway, you should be able to do something like:

//old name
    - name: swagger
      type: gogo
      flags: logtostderr=true,grpc_api_configuration=path/to/router.yaml
      output: .
//new name
    - name: openapiv2
      type: gogo
      flags: logtostderr=true,grpc_api_configuration=path/to/router.yaml
      output: .

all options can be found in https://github.com/grpc-ecosystem/grpc-gateway/blob/master/protoc-gen-openapiv2/main.go

ziur
  • 17
  • 1