googleapis / googleapis/google-cloud-java

[sdk-platform-java] Handle `google.rpc.ErrorInfo` in HttpJson*Stub class

未关闭
#12,465 6 条评论 0 个 reaction 已指派 1 人 已被 @blakeli0 认领 在 GitHub 查看
priority: p3 type: feature request
主要语言
Java
星标
2.1k
派生
1.2k
平均合并
1 天 23 小时
30 天内合并 PR
154

描述

Followup on googleapis/java-spanner#2229.

The generated HttpJsonEchoStub can't handle message type: `google.rpc.ErrorInfo` introduced by `echo.proto` (version `0.29.0`).
A easy integration test:
```
@Test
public void testEchoErrorDetails() {
EchoErrorDetailsResponse response = httpjsonClient.echoErrorDetails(
EchoErrorDetailsRequest
.newBuilder()
.setSingleDetailText("singleDetailText1774380934")
.addAllMultiDetailText(new ArrayList<>())
.build());
assertThat(response.hasSingleDetail()).isEqualTo(true);
}
```
failed with the following error message:
```
Caused by: com.google.protobuf.InvalidProtocolBufferException: Cannot resolve type: type.googleapis.com/google.rpc.ErrorInfo
at com.google.protobuf.util.JsonFormat$ParserImpl.mergeAny(JsonFormat.java:1511)
```

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

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。