Skip to content

compute/v1: reservationSubBlocks.get missing allowReserved: true for parentName #3501

@martinb3

Description

@martinb3

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

  1. Attempt to use the generated Service.ReservationSubBlocks.Get method.
  2. Provide the parentName as specified in the API documentation: reservations/{res}/reservationBlocks/{block}.
  3. Observe that the SDK's internal URI builder escapes the forward slashes in parentName (e.g., reservations%2F...) because the parameter lacks the allowReserved: true attribute in the Discovery metadata.
  4. Note that users are currently forced to manually call url.PathEscape on the parentName to "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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p2Moderately-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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions