toProto3Json method

Object? toProto3Json({
  1. TypeRegistry typeRegistry = const TypeRegistry.empty(),
})
inherited

Returns an Object representing Proto3 JSON serialization of this.

The key for each field is be the camel-cased name of the field.

Well-known types and their special JSON encoding are supported. If a well-known type cannot be encoded (eg. a google.protobuf.Timestamp with negative nanoseconds) an error is thrown.

Extensions and unknown fields are not encoded.

The typeRegistry is be used for encoding Any messages. If an Any message encoding a type not in typeRegistry is encountered, an error is thrown.

Unknown field data, data for which there is no metadata for the associated field, will not be included.

Implementation

Object? toProto3Json(
        {TypeRegistry typeRegistry = const TypeRegistry.empty()}) =>
    _writeToProto3Json(_fieldSet, typeRegistry);