Skip to content
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

storage: Listing Buckets should return the same structure as the JSON API #8423

Closed
erezrokah opened this issue Aug 16, 2023 · 1 comment
Closed
Assignees
Labels
api: storage Issues related to the Cloud Storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@erezrokah
Copy link

Client

Storage

Environment

MacOS

Go Environment

go version go1.20.6 darwin/arm64

Code

return &BucketAttrs{

Listing buckets returns BucketAttrs which has a different structure than the JSON resource https://cloud.google.com/storage/docs/json_api/v1/buckets

Expected behavior

Listing buckets should return a similar response to the JSON API

Actual behavior

Listing buckets wraps the raw bucket response and normalizes fields

Additional context

It seems the .Net SDK does mimic the JSON API https://github.com/googleapis/google-api-dotnet-client/blob/492d0c312b872b2c09cf1bb803fe293e8593c27b/Src/Generated/Google.Apis.Storage.v1/Google.Apis.Storage.v1.cs#L6955

Also, it seems missing fields are added one at a time per request (#4804, #3608)

@erezrokah erezrokah added the triage me I really want to be triaged. label Aug 16, 2023
@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Aug 16, 2023
@noahdietz noahdietz added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed triage me I really want to be triaged. labels Aug 16, 2023
@tritone
Copy link
Contributor

tritone commented Aug 21, 2023

Yes, this is the design of the cloud.google.com/go/storage package; all API fields for resources such as bucket and object are wrapped in handwritten code. Of the other GCS clients some (such as Python, Java, C++) do it similarly to Go while others (such as .Net and Node or our raw Go client https://pkg.go.dev/google.golang.org/api@v0.138.0/storage/v1) expose the resource directly. It would be impossible to make such a transition for this package without a massive breaking change, which we don't intend to undertake.

@tritone tritone closed this as completed Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

3 participants