commit | bdd90b2b6d2ffe431aceaa3145ed40393d4acb0c | [log] [tgz] |
---|---|---|
author | Ömer Sinan Ağacan <omersa@google.com> | Thu Sep 01 13:29:36 2022 +0200 |
committer | GitHub <noreply@github.com> | Thu Sep 01 13:29:36 2022 +0200 |
tree | 52afdafae2f115dfb353fd3c7dbd0dfbddff1661 | |
parent | 53a1448f6da7a8035654cf502f1c62b45885bb63 [diff] |
Fix map decoding when key or value fields are missing (#745) Map fields are encoded as repeated message fields where the message field 1 is the key and 2 is the value. In proto syntax, a map field like map<int32, MyMessage> map_field = 1; is encoded as if it was repeated MapFieldEntry map_field = 1; where message MapFieldEntry { optional int32 key = 1; optional MyMessage value = 2; } Since map entries are ordinary messages, it's possible for a map entry to have no key or value fields. This PR updates map decoding to handle missing key and value fields. Three tests added for (1) missing key field (2) missing value field (3) missing key and value fields (entry message has 0 length prefix). Fixes #719
Protocol Buffers (protobuf) are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data.
This repository is home to packages related to protobuf for Dart.
Package | Description | Published Version |
---|---|---|
protobuf | A support library for the generated code | |
protoc_plugin | A Dart back-end for the protoc compiler | |
api_benchmark | Benchmarking for various API calls | |
query_benchmark | Benchmark for encoding and decoding of a “real-world” protobuf |