Properly serialize zero-value messages in a oneof group (#176)
Also improve test utils to make it easier to have multiple json examples. Co-authored-by: Christopher Chambers <chris@peanutcode.com>
This commit is contained in:
co-authored by
Christopher Chambers
parent
2f62189346
commit
342e6559dc
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"nothing": {}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
syntax = "proto3";
|
||||
|
||||
message Nothing {}
|
||||
|
||||
message MaybeNothing {
|
||||
string sometimes = 42;
|
||||
}
|
||||
|
||||
message Test {
|
||||
oneof empty {
|
||||
Nothing nothing = 1;
|
||||
MaybeNothing maybe1 = 2;
|
||||
MaybeNothing maybe2 = 3;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"maybe1": {}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"maybe2": {
|
||||
"sometimes": "now"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user