Skip to content

docs(storage): document apiResponse.data breaking change in v9.0.0 - #9892

Open
thiyaguk09 wants to merge 3 commits into
googleapis:mainfrom
thiyaguk09:docs/9869-update-apiresponse-migration
Open

thiyaguk09 wants to merge 3 commits into
googleapis:mainfrom
thiyaguk09:docs/9869-update-apiresponse-migration

Conversation

@thiyaguk09

Copy link
Copy Markdown
Contributor

Description

Documents that v9.0.0 nests JSON payload fields under apiResponse.data.

Impact

Prevents silent undefined lookups on apiResponse.prefixes and apiResponse.nextPageToken.

Changes

  • handwritten/storage/MIGRATION.md:
    • Added Section 9 explaining that methods passing the transport response through directly now return the full GaxiosResponse HTTP response object rather than just the parsed JSON body, with payload fields (prefixes, nextPageToken, items) nested under apiResponse.data.
    • Added "Before (v8.0.0)" and "After (v9.0.0)" code examples and a troubleshooting entry.
  • handwritten/storage/src/bucket.ts:
    • Updated Bucket#getFiles and Bucket#getFilesStream JSDocs, delimiter option docs, @returns tags, and code examples to use apiResponse.data.prefixes and apiResponse.data.
    • Updated Bucket#getNotifications, Bucket#createChannel, Bucket#createNotification, Bucket#delete, and Bucket#getMetadata JSDocs.
  • handwritten/storage/src/storage.ts:
    • Updated Storage#getBuckets, Storage#getHmacKeys, and Storage#getServiceAccount @typedef, @callback, @returns, and @example JSDocs.
  • handwritten/storage/src/file.ts and remaining src/ modules (acl.ts, channel.ts, hmacKey.ts, iam.ts, notification.ts, nodejs-common/service-object.ts):
    • Updated File#copy and other direct response pass-through methods to state that payload properties are nested under apiResponse.data.

Testing

  • Ran npm run lint in handwritten/storage with zero lint errors.
  • Ran npm run docs in handwritten/storage and verified generated JSDoc HTML output.
  • Ran npm run compile in handwritten/storage to verify CommonJS and ESM builds succeed.

Fixes #9869

Update MIGRATION.md and JSDoc comments across @google-cloud/storage to clarify that methods passing the HTTP response through directly (such as Bucket#getFiles, Storage#getBuckets, Storage#getHmacKeys, Bucket#getNotifications, and File#copy) now return the full GaxiosResponse object with JSON payload properties (e.g., prefixes, nextPageToken, items) nested under apiResponse.data.

Fixes googleapis#9869
@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Nov 18, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the migration guide and JSDoc comments across multiple files to document a breaking change in v9.0.0, where apiResponse now returns the full HTTP response object with payload properties nested under apiResponse.data. The review feedback identifies a critical runtime TypeError in a bucket.ts code example where a constant array is reassigned, suggesting mutating it with push instead. Additionally, it recommends correcting a non-standard lowercase array type in the JSDoc for channel.ts to Promise<[object]> for better type precision and consistency.

Comment thread handwritten/storage/src/bucket.ts Resolved
Comment thread handwritten/storage/src/channel.ts Resolved
@thiyaguk09
thiyaguk09 marked this pull request as ready for review November 19, 2026 05:52
@thiyaguk09
thiyaguk09 requested review from a team as code owners November 19, 2026 05:52

This branch has not been deployed

No deployments
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

storage 9.0.0: getFiles apiResponse is now the HTTP response, so the documented apiResponse.prefixes is undefined

1 participant