Skip to content

Releases: aaubry/YamlDotNet

Metadata update

22 Jun 08:14
5ec2dd7
Compare
Choose a tag to compare

This release adds the repository location to the package metadata. No functional changes were made.

Security issues and dropping legacy behaviors

21 Jun 23:42
Compare
Choose a tag to compare

/!\ 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 and Deserializer directly then changing their configutation.

    In most cases, the calls to the constructors should be replaced by
    instantiations of SerializerBuilder and DeserializerBuilder.
    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 the EnsureRoundtrip 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);

Add support for (de)serialization of System.Type

26 Jan 17:22
Compare
Choose a tag to compare
v4.3.0

Merge branch 'type-serialization'

Cleanup the project

24 Jan 16:49
Compare
Choose a tag to compare
  • Refactored the project and solution so that they load and build cleanly in VS2017.
  • Reviewed the target platforms.
    • The currently supported platforms are now:
      • .NET Framework 4.5
      • .NET Framework 3.5
      • .NET Framework 2.0 (experimental)
      • .NET Standard 1.3
      • Unity Subset v3.5
    • The following platforms are no longer supported:
      • Profile259 (please upgrade to netstandard)

Bug fixes

18 Dec 11:32
Compare
Choose a tag to compare
  • Fix nested reference merging.
  • Don't force coercion of dictionary keys to string.
  • Fix public static method determining in PORTABLE mode.

Bug fixes

27 Sep 20:45
Compare
Choose a tag to compare

Actualy cache in CachedTypeInspector.

Bug fixes

21 May 14:32
Compare
Choose a tag to compare
  • Fix parser behavior when skipComments == false
    In most cases, the parser failed to parse after encountering a comment.

Support .NET Core

21 May 14:32
Compare
Choose a tag to compare

New features

  • Support for .NET Core (netstandard1.3).
    The project files have been converted to the new format, which means that older versions of Visual Studio may be unable to load them.

Usability improvements

23 Jan 10:13
Compare
Choose a tag to compare

New features

  • 32bits Unicode code points in escape sequences and url-encoded tags are now properly handled.

  • Anchors can now be redefined in a document.
    This is to conform to the 1.1 spec as well as the 1.2 spec:

    3.2.2.2. Anchors and Aliases

    When composing a representation graph from serialized events, an alias node refers to the most recent node in the serialization having the specified anchor. Therefore, anchors need not be unique within a serialization.

  • Added support for tag mappings on the serializer.
    Use SerializerBuilder.WithTagMapping() to register a new tag mapping on the serializer.

  • Allow to unregister components from the SerializerBuilder and DeserializerBuilder.
    Use the Without... methods on SerializerBuilder and DeserializerBuilder for that.

  • New DateTimeConverter

    • It accepts DateTimeKind.Utc and Standard Date and Time Format Strings of "G" as its default parameters, if they are omitted.
    • For deserialisation, it accepts as many number of formats as we want. If a value doesn't match against provided formats, it will return FormatException. Please refer to my whole test cases.
    • For serialisation, it only considers the first format in the format list.
  • Improve the (de)serializer builders so that it is possible to wrap existing component registrations.

  • Added the ApplyNamingConventions property to YamlMemberAttribute.
    When this property is true, naming conventions are not applied to the associated member. This solves issue 228.

Bug fixes

Other

  • The samples have been added to the project as a new unit test project, to ensure that they stay up-to-date with the code.
    In the future, a documentation page will be generated from the samples, that will show the sample, its documentation and respective output.

Version 4.0.0

08 Sep 22:51
Compare
Choose a tag to compare

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 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