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:
nat
2021-03-15 13:52:35 +01:00
committed by GitHub
parent 2f62189346
commit 342e6559dc
13 changed files with 98 additions and 41 deletions

View File

@@ -699,7 +699,7 @@ class Message(ABC):
meta.number,
meta.proto_type,
value,
serialize_empty=serialize_empty,
serialize_empty=serialize_empty or selected_in_group,
wraps=meta.wraps or "",
)