fake-gcs-server: Missing `generation` field causes issues with official Google PHP Client

When a file is uploaded to the bucket with the PHP client provided by Google it expects generation field in the response, see: https://github.com/googleapis/google-cloud-php-storage/blob/main/src/Bucket.php#L301

Could you please change it so this field is present with a null value instead of omitting it from serialization when it’s not set?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (9 by maintainers)

Commits related to this issue

Most upvoted comments

As far as I understand the docs (https://cloud.google.com/storage/docs/object-versioning and https://cloud.google.com/storage/docs/metadata#generation-number) there is always a generation number returned, whether the versioning is enabled or not.

Oh gotcha, I missed this somehow. I guess we can always use the current time or something like that as the generation.

I’ll try to take care of it over the coming weeks if no one beats me to it.

As far as I understand the docs (https://cloud.google.com/storage/docs/object-versioning and https://cloud.google.com/storage/docs/metadata#generation-number) there is always a generation number returned, whether the versioning is enabled or not.

I would be grateful if you could please do this. I do not code in Go (It looks pretty simple to get into though!) and just wanted to use this project with Google PHP SDK for Cloud Storage.

Sorry I didn’t get to it today but I will make the change tomorrow.

I would be grateful if you could please do this. I do not code in Go (It looks pretty simple to get into though!) and just wanted to use this project with Google PHP SDK for Cloud Storage.