-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handling of map entries with omitted key or value (#1348)
According to [1], map encoding must be compatible with a repeated message using indices 1 and 2 for key and value. In particular this implies that both key and value may be omitted when they are equal to the default value - which some protobuf implementations like protobuf-c actually do. The comments in the added testcase are based on the output of protobuf-inspector [2]. [1] https://developers.google.com/protocol-buffers/docs/proto3#backwards-compatibility [2] https://github.com/jmendeth/protobuf-inspector Based-on-patch-by: Shrimpz <Shrimpz@qq.com> Co-authored-by: Alexander Fenster <fenster@google.com>
- Loading branch information
1 parent
7a25398
commit b950877
Showing
2 changed files
with
81 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters