gnostic icon indicating copy to clipboard operation
gnostic copied to clipboard

Default to gRPC path if no mapping is provided

Open Kryan90 opened this issue 1 year ago • 1 comments

I am using protoc-gen-openapi to generate api docs. The project is being built using connectrpc which uses GRPC_SERVICE_FULL_NAME/METHOD_NAME for paths.

We are currently adding this manually for each method, ie.

service MyService {
  rpc Foo(FooRequest) returns (FooResponse) {
    option (google.api.http) = {
      post: "/my.package.v1.MyService/Foo"
      body: "*"
    };
  }
}

Is there an existing way to use the GRPC_SERVICE_FULL_NAME/METHOD_NAME as a default? If not is that something you would consider adding? There is some precedence for this usage in Cloud Endpoints transcoding https://cloud.google.com/endpoints/docs/grpc/transcoding#where_to_configure_transcoding

Kryan90 avatar Feb 21 '24 16:02 Kryan90

Yes, in my opinion, the information corresponding to this option (google.api.http)... statement can theoretically be calculated automatically. If we don't have any special requirements, why should we spend a lot of effort to write it?

northsea4 avatar Aug 08 '24 06:08 northsea4