Replies: 2 comments 2 replies
-
Hi @bouk ! I'm not sure actually... @boukeversteegh wrote most of our wrap/unwrap code ... I could poke around to refresh my memory, but as a lazy ask @boukeversteegh wdyt of @bouk 's question? :-) Thanks! |
Beta Was this translation helpful? Give feedback.
-
the core reason for needing some sort of conversion step, is that some protobuf messages have a json representation that is different from their structure. so we have 4 representations of the same message.
by having a separate functions to convert a protobuf message either into typescript, or json, we can represent the object in all these ways.
I remember there are more nuances to this that what I explained above. If you really want to get into it, I suggest trying out what you had in mind, and then running the tests, to see where things will break. |
Beta Was this translation helpful? Give feedback.
-
Hello @stephenh!
One thing I don't understand about this project is why the wrap/unwrap methods are generated for some Messages like
google.protobuf.Value
. Why not just return the canonical JSON representation from theto/fromJSON
methods and call that recursively when serializing?Beta Was this translation helpful? Give feedback.
All reactions