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, although this isn't supported.
Is there an existing .proto message that would map to those messages? Perhaps
with some annotation to this more obvious schema, or being able to specify
a custom tag to determine which case of a oneof is in use (instead of the
default enum value)?
message Error {
string message = 1;
}
message Second {
int64 response = 1;
}
message MyUnion {
oneof Either {
Error err = 1;
Ok ok = 2;
}
}
--
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.