New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gax-php] feat: add REST headers #322
Conversation
@@ -64,6 +64,7 @@ public static function buildAgentHeader($headerInfo) | |||
// - gapicVersion (gapic/) | |||
// - apiCoreVersion (gax/) | |||
// - grpcVersion (grpc/) | |||
// - restVersion (rest/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to add this to the $headerInfo
phpdoc for the method!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
src/GapicClientTrait.php
Outdated
// a REST-only library, then the grpcVersion header should not be set. | ||
if ($this->transport instanceof GrpcFallbackTransport) { | ||
$options['grpcVersion'] = phpversion('grpc'); | ||
$options['restVersion'] = Version::getApiCoreVersion(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As GrpcFallbackTransport
doesn't actually use the grpc
extension (or grpc), I'm not sure we want to set the grpc/
header, as it's most likely going to be empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Co-authored-by: David Supplee <dwsupplee@gmail.com>
This is needed primarily for REGAPIC. However, sending the REST header can also benefit gRPC and REST GAPIC libraries (the default) as well, since we don't support gRPC-only libraries.
Using gax-php's version as the default REST version.