I am writing a protoc plugin which outputs documentation files from 
protobuf sources in python.

I would like to produce binary files (a PNG image with a nice diagram), 
however, this is impossible because CodeGeneratorResponse.File.content is a 
"string" field, rather than a "bytes" field, which must be a valid UTF-8 
string in python 3.

Does anyone see a way to work around this limitation? At the moment, I 
embed my images in base64 in the produced files, but that's not exactly the 
kind of solution I'm looking for.

If not, would anyone be interested in allowing to produce binary files?
It can probably be implemented in a backward compatible way using something 
oneof { string content, bytes raw_content }.


You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to