commit | b7613581d847e1e36e76f0e36db3a412d8fea5b1 | [log] [tgz] |
---|---|---|
author | Nate Biggs <biggs0125@gmail.com> | Mon Mar 04 03:37:20 2024 -0500 |
committer | GitHub <noreply@github.com> | Mon Mar 04 09:37:20 2024 +0100 |
tree | 71224b461f73f610a24554ba9903d18253eb7518 | |
parent | 1822b81df565f7b7d54450b33fa2c997f69a9995 [diff] |
Support unknown json data and add internal set/clear field methods for generated accessors. (#918) Add support for unknown fields to JSON (de-)serialized proto messages. This allows data to be roundtripped from a server via this format without dropping fields when the client doesn't contain metadata for some fields. Store the data as decoded but unparsed json and append it back to the message when re-serializing a message. Ignore unknown json data for equality/hashing to preserve existing behavior for users. Taking this data into account would change the result of existing `==` and `hashCode` calls. By separating out `$_setField` and `$_clearField` this allows one to differentiate reflective uses of `setField` and `clearField` (i.e. from user code, usually with the result of `getTagNumber`) vs. internal uses from the generated accessors. Fixes #49. --- cl/611522109 cl/612283849 --------- Co-authored-by: Nate Biggs <natebiggs@google.com> Co-authored-by: Ömer Sinan Ağacan <omersa@google.com>
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 |
For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.