-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Client
Compute (but likely others, as well, due to code generation and sharing)
Dependencies
go.mod
module modname
go 1.23.2
require (
...
cloud.google.com/go/compute v1.31.1
github.com/googleapis/gax-go/v2 v2.14.1
google.golang.org/api v0.215.0
google.golang.org/grpc v1.69.2
google.golang.org/protobuf v1.36.2
...
)
Expected behavior
API field validation details are preserved in Bad Request scenarios.
Actual behavior
With the recent update to the compute/apiv1/helpers.go (https://github.com/googleapis/google-cloud-go/blob/d448fbb8ff228b1081ebbc98ee13e2a49e2b373c/compute/apiv1/helpers.go), 400 Bad Request errors are being stripped of their details due to what I'm fairly certain is a bug trying to double-read the response body.
The response body is read here, and then again within the googleapi.CheckResponse call.
This returns error strings like "googleapi: Error 400:", where previously the failure would contain the invalid field details (e.g. Invalid value for field 'resource.instanceProperties.machineType').
Additional context
I believe this issue is caused by this PR.