Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Groups are a deprecated proto2 feature. On the syntax level, they allow to declare a field and a message at the same time. On the wire level, the group message is encoded with delimited tags instead by length.
Here is an example - message
M
has a group fieldg
:In descriptors, groups are represented as messages, and like many other implementations, Protobuf-ES generates groups as messages, Unfortunately, it does not implement the group wire format, and fails to serialize / parse messages correctly from the binary format.
This PR adds the following method to
DescMessage
:For message
M
, the method returns false, but for messageM.G
, the method returns true.To avoid serializing broken data, this PR updates
protoc-gen-es
to not generate code for groups. MessageM.G
and the fieldM.g
will not be included in the generated code. Groups will still be handled as unknown fields, and are retained in a serialization roundtrip.Since the group encoding will be revived with editions with the
message_encoding
feature, we will implement the group encoding soon, and it's quite possible we'll be able re-enable code generation for proto2 groups.