Open JoeWang1127 opened 1 year ago
In the possible solution part, the types are added recursively in TypeRegistry.Builder.add()
method.
However, only two types serves as the "root" of this method, WaitRequest
and WaitResponse
, we need to understand the reason behind this before adding ErrorInfo
into the registry.
Took a look at some of the code in Gax and I believe it may be due to the ProtoOperationTransformers: https://github.com/googleapis/sdk-platform-java/blob/9d30ed9b05dd77348899d312117e3fb562e7e6bd/gax-java/gax-grpc/src/main/java/com/google/api/gax/grpc/ProtoOperationTransformers.java#L130-L140
ServiceStubSettings transforms it from Any to the classes: https://github.com/googleapis/sdk-platform-java/blob/9d30ed9b05dd77348899d312117e3fb562e7e6bd/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/EchoStubSettings.java#L792-L795
I believe conversion from Any -> Class would require a TypeRegistry.
I'm afraid this issue is more complicated than we expected. The new Showcase feature tests that we can deserialize an Any
field to a concrete field in ErrorInfo
, which is only used by the Error Details feature, and it was deferred last year. See b/260671246 for details. In short, we can not support this test for HttpJson stubs until Error Details feature is implemented for REGAPIC.
In the mean time, I think it's still worth it to add a showcase test for gRPC.
we can not support this test for HttpJson stubs until Error Details feature is implemented for REGAPIC
I'll be demoting this to p3
Verified that adding ErrorInfo
to the type registry should fix this issue, see https://github.com/googleapis/sdk-platform-java/pull/3093. However, we need to figure out where exact to add the additional types, either in Gax or generated layers.
Theoretically this issue can be tackled individually, but it will likely be resolved if the actionable ErrorDetails project is implemented for httpjson. Hence keeping this as a P3.
Followup on #2229.
The generated HttpJsonEchoStub can't handle message type:
google.rpc.ErrorInfo
introduced byecho.proto
(version0.29.0
). A easy integration test:failed with the following error message:
Possible solution: Add the message type in https://github.com/googleapis/sdk-platform-java/blob/003b993f7ad7cae8ae8c101e0ff147e517dcd83e/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/rest/HttpJsonServiceStubClassComposer.java#L1279-L1286