ProtoConfig
Available in a dev version: 0․11․0-grpc-186
How to configure
Configuration options for Protobuf message encoding and decoding.
This class implements GrpcMarshallerConfig to provide Protobuf-specific configuration that controls how messages are serialized and deserialized when using Protobuf marshallers generated from .proto files using kotlinx-rpc.
Example:
// Create a marshaller with custom config
val config = ProtoConfig(discardUnknownFields = true)
val myMarshaller = grpcMarshallerOf<MyMessage>(config)
// Or pass config per-operation
val decoded = marshaller.decode(stream, config)See also
Constructors
Properties
When true, unknown fields encountered during deserialization are silently discarded. When false (default), unknown fields are preserved.
Registry of known protobuf extensions used during decoding. If set, extension fields matching registered descriptors are decoded. If null (default), extension fields are treated as unknown fields.
The maximum allowed nesting depth when decoding protobuf messages. Messages nested deeper than this limit will cause a kotlinx.rpc.protobuf.internal.ProtobufDecodingException. Defaults to DEFAULT_RECURSION_LIMIT (100), matching Google's protobuf default.