ProtoConfig

Available in a dev version: 0․11․0-grpc-188

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 config using the DSL builder
val config = ProtoConfig {
discardUnknownFields = true
extensions {
+MyMessage.myExtension
}
}
val myMarshaller = grpcMarshallerOf<MyMessage>(config)

// Or pass config per-operation
val decoded = marshaller.decode(stream, config)

See also

Types

Link copied to clipboard
class Builder

Mutable builder for ProtoConfig.

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

When true, unknown fields encountered during deserialization are silently discarded. When false (default), unknown fields are preserved.

Link copied to clipboard

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.

Link copied to clipboard

The maximum allowed nesting depth when decoding protobuf messages. Messages nested deeper than this limit will cause a ProtobufDecodingException. Defaults to DEFAULT_RECURSION_LIMIT (100), matching Google's protobuf default.