[api] Collapse the generator's per wire type decode hooks into one

A type now sets a single decode_expr; the wire type it already declares picks the case
label. Drops the unused force_str helper, two dead decode_length overrides, a duplicate
field builder in the generator tests and a needless list copy in the state waiter. The
generated files are unchanged.
This commit is contained in:
J. Nick Koston
2026-09-07 15:57:13 +02:00
parent 6d23e4c842
commit a79cd1550c
2 changed files with 21 additions and 49 deletions
@@ -38,7 +38,8 @@ def _file_with_messages(
file_desc = descriptor_pb2.FileDescriptorProto(name="test.proto")
for name, field_type, deprecated in messages:
msg = file_desc.message_type.add(name=name)
field = msg.field.add(name="value", number=1, type=field_type)
field = msg.field.add()
field.CopyFrom(_field(field_type))
field.options.deprecated = deprecated
return file_desc