Btw, I found the answer. We can use Reflection C++ to do it. Thanks all On Sunday, March 29, 2020 at 11:19:11 PM UTC+7, Nghia Tran wrote: > > Hi, > > From what I understanding, given a Protobuf Scheme and the Protobuf Binary > file, we can convert the binary to JSON by following: > > 1. Generate the models from the scheme by > protoc --swift_out=. BookInfo_scheme.proto > > 2. Init models from the binary file > let decodedInfo = try BookInfo(serializedData: binaryData)) // swift > > 3. Serialize to JSON > let jsonData: Data = try info.jsonUTF8Data() //swift > > 4. Convert Data to JSON String > > *Question: How can I achieve it without generating those Models? * > > I did a research that Charles Proxy could do it by given protobuf binary > and protobuf descriptor. Thus the solution is possible, but I couldn't find > any documentation on how to implement it in C++ or Java or Swift. > > Thanks in advance. >
-- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/protobuf/4eed55a4-2413-434b-8a57-03e4a162224d%40googlegroups.com.
