googleapis / googleapis/google-cloud-java

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

Open
#12,465 6 comments 0 reactions 1 assignee Claimed by @blakeli0 View on GitHub
priority: p3 type: feature request
Dominant language
Java
Stars
2.1k
Forks
1.2k
Avg merge
1d 23h
Merged PRs (30d)
154

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.