Google-recommended way of structuring resource path is not supported (https://google.aip.dev/127)
Gugic opened this issue · 2 comments
Hi, I am trying to setup grpc-gateway for the service and doing it using Google AIP recommendations and provided linter.
So if you would take a look at https://google.aip.dev/127 - the recommended way of using http annotations for more or less complicated APIs looks like that:
post: "/v1/{parent=publishers/*}/books"
However protoc-gen-grpc-gateway-ts would not generate expected for that case /v1/${req["parent"]}/books
, instead of that protoc-gen-grpc-gateway-ts would generate /v1/${req["parentpublishers"]}/books
There is also more complicated, but also commonly used case when (e.g. for update requests) nested field is used as a part of resource path, look at the Dialogflow proto for example: https://github.com/googleapis/googleapis/blob/master/google/cloud/dialogflow/cx/v3/intent.proto#L80
They have
option (google.api.http) = {
patch: "/v3/{intent.name=projects/*/locations/*/agents/*/intents/*}"
body: "intent"
};
That technically should be translated into /v3/${req["intent"]["name"]}
grpc-gateway itself fully supporting such a usecase