cloud-storage-rs icon indicating copy to clipboard operation
cloud-storage-rs copied to clipboard

Deserialization errors

Open chrisboyce opened this issue 2 years ago • 2 comments

It appears that the serde attributes for at least some of the structs don't match what GCP is actually returning. For instance, a bucket has a StorageClass of "ARCHIVE" which is not in the StorageClass enum. I'm happy to add missing items as a PR, but is there a canonical source for the schema (specifically with regards to whether and item is an Option)? I haven't been able to find one, but I'm reluctant to start making a bunch of fields optional, such as the cors field.

chrisboyce avatar Apr 12 '22 00:04 chrisboyce

No I haven't been able to find a truly comprehensive source that explains which fields are required and which are not, so the current implementation is on a best-effort basis. If this is causing bugs for you in practice then please do submit a PR that fixes the errors that you run into, I'd be happy to accept it.

ThouCheese avatar May 07 '22 23:05 ThouCheese

It seems google has removed the field "timeDeleted" from the response so the response fails to deserialize into an "Object". The solution to this general problem is to not make any fields required and allow unknown fields to not fail either.

mattwowza avatar May 09 '22 21:05 mattwowza