On Tue, May 10, 2016 at 7:31 AM, Marco Farrugia wrote:
> Unnecessary being that deserialization ismore than a switch on the type.
> The Union approach also puts all the fields on one object, as opposed to
> separating by the type field - this is what I wanted to confirm as
>
Unnecessary being that deserialization ismore than a switch on the type.
The Union approach also puts all the fields on one object, as opposed to
separating by the type field - this is what I wanted to confirm as
unsupported by protobuf.
On Tue, May 10, 2016, 10:22 Tim Kientzle
That does work, but it seems like it creates a lot of unnecessary work if
there are many fields.
Is there a better way to handle a schema more like this?
{ type: "error", message: "wrong"} or { type:"ok", a: 1, b:2, c:3, d:4,
... }.
On Monday, May 9, 2016 at 3:12:19 PM UTC-4, Feng Xiao
On Fri, May 6, 2016 at 8:18 PM, Marco wrote:
> I'm looking to generate de/serialization for json tagged union messages
> from an external rest api, eg.
> { type: "error", message: "wrong"} or { type:"ok", response: { a: 1, b:
> 2}}.
>
> Reading the docs it seems like an any
I'm looking to generate de/serialization for json tagged union messages
from an external rest api, eg.
{ type: "error", message: "wrong"} or { type:"ok", response: { a: 1, b: 2}}.
Reading the docs it seems like an any valued field the type field modified
json_name would work similarly,