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

FileMetadata type missing null on metadata for delete #2441

Closed
p-young opened this issue Apr 18, 2024 · 1 comment · Fixed by #2442
Closed

FileMetadata type missing null on metadata for delete #2441

p-young opened this issue Apr 18, 2024 · 1 comment · Fixed by #2442
Assignees
Labels
api: storage Issues related to the googleapis/nodejs-storage API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@p-young
Copy link

p-young commented Apr 18, 2024

For the property 'metadata' on type FileMetadata (which is used in places like File.setMetadata())
image

It is typed as Record<string, string>, but it needs to allow null too (so Record<string, string | null>)

Null is used to delete the key, as in the documentation:
https://googleapis.dev/nodejs/storage/latest/File.html#setMetadata
image

Thanks and let me know if you have any questions

@p-young p-young added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Apr 18, 2024
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/nodejs-storage API. label Apr 18, 2024
@p-young
Copy link
Author

p-young commented Apr 18, 2024

Additionally, although not in the documentation, 'metadata' would also accept boolean value fields and it would work.

metadata: { someKey: true }

Should it be Record<string, boolean | null | string>?

Previously, it was just type 'object' which allowed many values.

Thanks

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 googleapis/nodejs-storage API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants