Skip to content

Commit 8814b91

Browse files
authored
Set serialized_on_wire when parsing (#2)
This is similar to the fix at danielgtaylor#81, but that doesn't merge into our branch because our branch is too old. So this just pulls in the relevant fix part.
1 parent 47e1071 commit 8814b91

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

betterproto/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,7 @@ def parse(self: T, data: bytes) -> T:
664664
fields = {f.metadata["betterproto"].number: f for f in dataclasses.fields(self)}
665665
for parsed in parse_fields(data):
666666
if parsed.number in fields:
667+
self._serialized_on_wire = True
667668
field = fields[parsed.number]
668669
meta = FieldMetadata.get(field)
669670

0 commit comments

Comments
 (0)