Closed kmathew closed 1 year ago
I've never observed the crc32c
being absent in a list objects response - the md5Hash field is documented to be optional, but not the crc32c. Is there something special about these objects?
@danburkert
In the JSON API, the objects resource md5Hash and crc32c properties contain base64-encoded MD5 and CRC32C hashes, respectively. Providing either metadata property is optional. Supplying either property as part of a resumable upload or JSON API multipart upload triggers server-side validation for the new object. If Cloud Storage calculates a value for either property that does not match a supplied value, the object is not created. If the properties are not provided in an upload, Cloud Storage calculates the values and writes them to the object's metadata.
https://cloud.google.com/storage/docs/hashes-etags#json-api
Because either of these can be omitted when writing object, crc32c
in fact can be optional.
At least that's how I read it
crc32c is an optional field and was the only field with the issue. The PR to treat it as optional was merged and this issue is resolved.
Error: HttpClient(reqwest::Error { kind: Decode, source: Error("missing field
crc32c", line: 23, column: 5) })
The code above fails to properly decode the response. It's requiring fields that are available only when getting a specific object.
Typical JSON Response:
Need to define a struct to handle for list object's case or make some of the existing fields in Object optional.