gapic-generator-java icon indicating copy to clipboard operation
gapic-generator-java copied to clipboard

Encode any Enums in Routing Header as an Int

Open lqiu96 opened this issue 2 years ago • 3 comments

See go/clientlibs-routine-headers-numeric-enums for more information.

Enums in every implicit/ explicit routing header should be encoded as an Int.

The Routing Headers seem to be encoded here via a ParamsExtractor. Example: https://github.com/googleapis/sdk-platform-java/blob/44701e88de88428fb8a94692ffcc85ac815cc203/showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/HttpJsonComplianceStub.java#L850-L855 This should be modified to get the Int value instead.

Generator changes: Affect the AbstractTransportServiceStubClassComposer. Specifically around: https://github.com/googleapis/sdk-platform-java/blob/44701e88de88428fb8a94692ffcc85ac815cc203/gapic-generator-java/src/main/java/com/google/api/generator/gapic/composer/common/AbstractTransportServiceStubClassComposer.java#L1252-L1258

Both methods should be modified so that the changes are applied for both implicit and explicit routing headers.

lqiu96 avatar Sep 06 '23 22:09 lqiu96

Created a new issue for implicit routing headers case - https://github.com/googleapis/sdk-platform-java/issues/2368 . Implemenation PR - https://github.com/googleapis/sdk-platform-java/pull/2328

ddixit14 avatar Jan 16 '24 15:01 ddixit14

FYI, only implicit routing headers can be fixed currently because explicit routing headers are implemented as strings by design. See this doc for more details.

ddixit14 avatar Jan 16 '24 17:01 ddixit14

Implicit Routing Headers were implemented. Discussion is pending explicit routing headers and how to properly implement it.

lqiu96 avatar Mar 04 '24 15:03 lqiu96