This a major release that introduces a few breaking changes.
-
The constructors of
Serializer
andDeserializer
are now obsolete
Except for the parameterless versions. TheSerializerBuilder
andDeserializerBuilder
classes should now be used to configure and create instances of the (de)serializer. -
Replaced the
IYamlSerializable
interface withIYamlConvertible
TheIYamlSerializable
is now obsolete, but will be kept until the next major release. -
Removed
EventReader
EventReader
was a wrapper overIParser
that offered some abstractions for parsing, but also had some design flaws. It has been replaced by extension methods forIParser
. The extension methods provide the same functionality, and allow to always use the same type to represent the parser. -
Dropped support for
YamlAliasAttribute
This class has been obsolete for many releases, and it was time to let it go.
-
SerializerBuilder
andDeserializerBuilder
This is an important change that adds "builders" that can be used to configure the Serializer and Deserializer through a fluent syntax. The main objective of this is to allow more control over the composition of services performed by these two classes. This means that every aspect of the composition should be extensible / overridable. Things like injecting a custom TypeInspector or replacing the default ArrayNodeDeserializer with an alternative implementation become possible and easy.
In order to avoid breaking existing code, the constructors of Serializer and Deserializer have been kept but marked as obsolete. In a future release they will be discarded. -
Added the
IYamlConvertible
interface
This new interface differs in that its methods receive a delegate that can be used to reuse the current serializer or deserializer. -
Improved the usability of
YamlDocument
and other RepresentationModel classes:- Added conversion operators and indexers for easier parsing and construction of YamlNodes.
YamlMappingNode
,YamlSequenceNode
andYamlScalarNode
now implementIYamlConvertible
, which means that these types can appear in the middle of an object that is being serialized or deserialized, and produce the expected result.
-
Added support for alternative Boolean values
- True:
true
,y
,yes
,on
- False:
false
,n
,no
,off
.
- True:
- Serialization Error when string starts with quote
- YamlVisitor is marked as obsolete, but no YamlVisitorBase class exists
- Do not assign anchors to scalars during serialization.