Change BinaryEncoder mode to be NonStrict by default in constructor
bjakke opened this issue · 0 comments
Currently BinaryEncoder constructors defaults to EncoderMode.Strict which means it will throw instead of using default values if it's trying to encode a null value for a type which does not have UA Null encodings (e.g. Int/UInt types use 0 if null is put in NonStrict).
However all places in the code which use BinaryEncoder always set the model to NonStrict after creation, i.e. outside of some tests that do not use those types, the stack always uses the NonStrict mode and there is no hook to change that. Therefore I would say in 1.04 it is best to change the default to be NonStrict and in rare cases where Strict is wanted (outside of the stack in practice if any) it can be changed after making the BinaryEncoder instance.