Security issues and dropping legacy behaviors
/!\ This release fixes a security issue. It is strongly recommended to upgrade,
mainly if you are parsing documents from sources that you do not trust.
Many thanks to Kurt Boberg, from the DocuSign Application Security Team, who identified this issue and provided feedback on mitigation strategies.
-
Remove the legacy backwards-compatibe syntax that enabled to create
Serializer
andDeserializer
directly then changing their configutation.
In most cases, the calls to the constructors should be replaced by
instantiations ofSerializerBuilder
andDeserializerBuilder
.
These can be configured at will, then used to create instances of
(De)serializer.
It is still possible to use the default constructors, if no configuration is needed. -
Drop support for specifying arbitrary type names in tags.
Support for automatically resolving a fully qualified type name
from a tag has been discontinued. That feature was poorly designed
and not standard.
During deserialization, each tag mapping must be explicitly registered.
During serialization, when using theEnsureRoundtrip
method, it is necessary to
register tag mappings for each type that will require a tag, that is, any type that
is used as the value of a property with a different declared type. -
Fix bug where deserialized values were not being converted to the destination type.
var sut = new DeserializerBuilder() .WithTagMapping("!dbl", typeof(DoublyConverted)) .Build(); // The scalar "hello" will first be converted to DoublyConverted // then that value will be converted to int. var result = sut.Deserialize<int>("!dbl hello"); Assert.Equal(5, result);