-
Notifications
You must be signed in to change notification settings - Fork 1.2k
compute/v1: reservationSubBlocks.get missing allowReserved: true for parentName #3501
Copy link
Copy link
Open
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Is this a client library issue or a product issue?
This is a client library issue resulting from incorrect API metadata in the Discovery Document used for generation.
Environment details
- Programming language: Go
- OS: N/A (General SDK issue)
- Language runtime version: Go 1.21+
- Package version:
google-api-go-client/compute/v1
Steps to reproduce
- Attempt to use the generated
Service.ReservationSubBlocks.Getmethod. - Provide the
parentNameas specified in the API documentation:reservations/{res}/reservationBlocks/{block}. - Observe that the SDK's internal URI builder escapes the forward slashes in
parentName(e.g.,reservations%2F...) because the parameter lacks theallowReserved: trueattribute in the Discovery metadata. - Note that users are currently forced to manually call
url.PathEscapeon theparentNameto "trick" the library into producing a valid URL for the backend.
Technical Root Cause
The Discovery Document for compute.reservationSubBlocks.get defines the parentName parameter as follows:
"parentName": {
"description": "The name of the parent reservation and parent block. In the format of\nreservations/{reservation_name}/reservationBlocks/{block_name}",
"location": "path",
"required": true,
"type": "string"
}
Because the value must contain forward slashes to reach the endpoint as defined in the path and flatPath, this parameter requires "allowReserved": true. Without this attribute, the Go generator assumes the string is a single path segment and escapes it strictly.
Please update the Discovery metadata for this resource to include "allowReserved": true.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.