Closed aengelas closed 1 year ago
A coworker correctly pointed out that this works because the bytes are expected to by base64-encoded. I think it'd be worthwhile adding this to the docs, and/or changing the interface to accept Vec<u8>
and do the encoding internally. Again, given the auto-generated nature of the interface, I'm not sure if there's a good solution.
It's possible to setup per-API overrides which is currently only done for the YouTube API. However, each kind of override would need to be implemented which can be contributed.
In the hopes that issues serves as documentation, I am closing this issue, but that shouldn't stop anyone to contribute a way to make amendments to the docs on a per-API basis. Thanks for your understanding.
I'm attempting to create and upload pprof CPU profiles via the
google_cloudprofiler2
crate, but encountering an issue getting the.proto
contents into theprofile_bytes
field of thegoogle_cloudprofiler2::api::Profile
struct. As far as I'm aware, a .proto file will not always be valid UTF-8 (maybe never?), and the documentation indicates:https://github.com/Byron/google-apis-rs/blob/8e4ec82be7c7425924cb1cf4d3b36070b3424fc8/gen/cloudprofiler2/src/api.rs#L235-L237
It's not clear to me what the expectation is here; I'd assume it would accept something like
Vec<u8>
,&[u8]
or some sort of Byte type. I see in the protobuf definitions that it's astring
type, but I assume that protobuf is more lenient with non-utf8 strings?I'd love a) confirmation that this is an issue; b) guidance on how to fix it. I'm happy to contribute the fix, but there are a lot of moving parts in this repo.