protoc-gen-grpc-gateway-ts icon indicating copy to clipboard operation
protoc-gen-grpc-gateway-ts copied to clipboard

Support nested fields, path segments

Open mbarrien opened this issue 2 years ago • 2 comments

Closes #28

Adds support for 2 related cases in URLs:

  • Support path segments like in https://google.aip.dev/127, where the URL contains a pattern like post: "/v1/{parent=publishers/*}/books"
  • Support nested field names in the URL, where the URL is structured like:
      option (google.api.http) = {
        patch: "/v3/{intent.name=projects/*/locations/*/agents/*/intents/*}"
        body: "intent"
      };
    
    This gets translated to /v3/${req["intent"]["name"]}

While here, use the newer protoc-gen-go-grpc plugin for generating server test code, due to deprecated usage of plugin=grpc (see https://github.com/protocolbuffers/protobuf-go/releases/tag/v1.20.0#v1.20-grpc-support)

mbarrien avatar Mar 30 '22 02:03 mbarrien

This fix works perfect for our use case, please merge it. @mbarrien

hcwang512 avatar Apr 06 '22 09:04 hcwang512

we really need this patch, can someone do some magic and make ci happy ? 😭

yeluyang avatar Oct 08 '22 02:10 yeluyang