Skip to content

Latest commit

 

History

History
59 lines (44 loc) · 2.92 KB

4.0.0.md

File metadata and controls

59 lines (44 loc) · 2.92 KB

Release 4.0.0

This a major release that introduces a few breaking changes.

Breaking changes

  • The constructors of Serializer and Deserializer are now obsolete
    Except for the parameterless versions. The SerializerBuilder and DeserializerBuilder classes should now be used to configure and create instances of the (de)serializer.

  • Replaced the IYamlSerializable interface with IYamlConvertible
    The IYamlSerializable is now obsolete, but will be kept until the next major release.

  • Removed EventReader
    EventReader was a wrapper over IParser that offered some abstractions for parsing, but also had some design flaws. It has been replaced by extension methods for IParser. 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.

New features

  • SerializerBuilder and DeserializerBuilder
    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 and YamlScalarNode now implement IYamlConvertible, 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.

Bug fixes