Instance Propertyswift-protobuf 1.28.1SwiftProtobuf
discardUnknownFields
Discard unknown fields while parsing. The default is false, so parsering does not discard unknown fields.
BinaryDecodingOptions.swift:36var discardUnknownFields: Bool
The Protobuf binary format allows unknown fields to be still parsed so the schema can be expanded without requiring all readers to be updated. This works in part by having any unknown fields preserved so they can be relayed on without loss. For a while the proto3 syntax definition called for unknown fields to be dropped, but that lead to problems in some case. The default is to follow the spec and keep them, but setting this option to true
allows a developer to strip them during a parse in case they have a specific need to drop the unknown fields from the object graph being created.
Other members in extension
Type members
Instance members
var messageDepthLimit: Int
The maximum nesting of message with messages. The default is 100.