Skip to content

Releases: aaubry/YamlDotNet

Add support for nullable references and netstandard 2.1

28 Sep 16:32
Compare
Choose a tag to compare

Release 7.0.0

Added support for nullable references and netstandard 2.1.

Enabling nullable references exposed many potential bugs where the code assumed
that a reference would not be null, but where it was possible for it to be null.
In most cases this did not cause an error because of the way the code was being used.

Because fixing these problems required some breaking changes, a few improvements were made to the code base to take advantage of modern C# constructs.

Overall, the following breaking changes were made:

  • Removed the default constructor from most exceptions, because that would cause some uninitialized properties.

  • Made the ParsingEvent concretizations sealed. There is no point in inheriting from these because the library assumes that they form a closed set.

  • Made many classes sealed, since they are not intended to be extended.

  • YamlDocument now throws an exception if is has no root node after loading. This should only happen when loading from an IParser that returns invalid data or is in an invalid state.

The following APIs were made obsolete (but still work as before):

  • Refactored the extension methods to IParser to have better names with a more sensible semantic. The previous extension methods, Expect<T>, Allow<T>, Peek<T> and Accept<T> are still available but have been deprecated. The new extension methods are:

    • T Consume<T>() where T : ParsingEvent
      Ensures that the current event is of the specified type, returns it and moves to the next event. Throws an exception if the next event is not of the expected type.

    • bool TryConsume<T>(out T @event) where T : ParsingEvent
      If the event is of the specified type, returns it and moves to the next event, otherwise returns null.

    • T Require<T>() where T : ParsingEvent
      Enforces that the current event is of the specified type.

    • bool Accept<T>(out T @event) where T : ParsingEvent
      Checks whether the current event is of the specified type.

  • Made the constructor of all naming conventions obsolete. Instead each has a static property named Instance. There was no point in creating multiple instances of those classes.
    Instead of:

    new SerializerBuilder()
        .WithNamingConvention(new CamelCaseNamingConvention());

    Use:

    new SerializerBuilder()
        .WithNamingConvention(CamelCaseNamingConvention.Instance);

Improve conformance with the official test suite

28 Sep 16:31
Compare
Choose a tag to compare

Release 6.1.2

Improves conformance with the official test suite:

  • W4TN (Spec Example 9.5. Directives Documents)
  • 2LFX (Spec Example 6.13. Reserved Directives [1.3])
  • 6LVF (Spec Example 6.13. Reserved Directives)
  • S3PD (Spec Example 8.18. Implicit Block Mapping Entries)
  • NHX8 (Empty Lines at End of Document)
  • 2JQS (Block Mapping with Missing Keys)
  • M7A3 (Spec Example 9.3. Bare Documents)
  • WZ62 (Spec Example 7.2. Empty Content)
  • 52DL (Explicit Non-Specific Tag [1.3])
  • S4JQ (Spec Example 6.28. Non-Specific Tags)
  • 8MK2 (Explicit Non-Specific Tag)
  • R4YG (Spec Example 8.2. Block Indentation Indicator)
  • 6BCT (Spec Example 6.3. Separation Spaces)
  • A2M4 (Spec Example 6.2. Indentation Indicators)
  • Q5MG (Tab at beginning of line followed by a flow mapping)
  • S7BG (Colon followed by comma)
  • DK3J (Zero indented block scalar with line that looks like a comment)
  • FP8R (Zero indented block scalar)
  • 4MUZ (Flow mapping colon on line after key)
  • NJ66 (Multiline plain flow mapping key)
  • UT92 (Spec Example 9.4. Explicit Documents)
  • 9SA2 (Multiline double quoted flow mapping key)
  • K3WX (Colon and adjacent value after comment on next line)
  • 5MUD (Colon and adjacent value on next line)

Also adds the license file to nupkg to fix NU5125 warning.

Add tests from the official test suite

28 Sep 16:31
Compare
Choose a tag to compare

Release 6.1.1

New features

Tests from yaml-test-suite have been added to the project and an effort has been made to improve the conformance, thanks to @am11:

  • #395 Add spec test executor for yaml-test-suite
  • #400 Improve YAML spec conformance by three tests
  • #401 Allow scalar to have value without space (x:y)
  • #403 Relax anchor names allowed characters set
  • #404 Constrain DocumentEnd parsing to allowed tokens
  • #406 Improve omitted keys handling

Other changes:

  • Allow to save a YamlStream to an IEmitter
  • Some infrastructural changes have been made to ensure that the project would build on Linux without issues.

Bug fixes

  • #396 Fix missing string quotes around json serialized enums (fixes #146)
  • Increase the max simple key length to 1024 and allow to configure it
  • Never emit key indicators in JSON

Merge YamlDotNet.Signed and YamlDotNet packages

15 Mar 17:53
Compare
Choose a tag to compare

This release merges the YamlDotNet.Signed and YamlDotNet packages, as discussed in #390.
This change has the following consequences:

  • The assemblies in the YamlDotNet package will now have strong names.
    This is a breaking change. If you depend on a library that depends on a
    previous version of YamlDotNet, you will first need to update that library.

  • The YamlDotNet.Signed package will cease to be published.
    The code should be updated to depend on YamlDotNet.

Enable serialization of public fields

06 Mar 23:57
Compare
Choose a tag to compare

YamlDotNet will now also serialize public fields. This feature is enabled by default, but it can be disabled by calling IgnoreFields() on the SerializerBuilder or DeserializerBuilder.

More detailed exception

06 Mar 23:55
Compare
Choose a tag to compare

New features:

  • Produce a detailed error message when too much recursion is detected during serialization.

Make configuration more flexible

06 Mar 23:54
Compare
Choose a tag to compare

New features:

  • Add support for supplying custom IObjectGraphTraversalStrategy implementations.
  • Add abstract WithTagMapping() method to the base serializer / deserializer builder.

Bug fixes:

  • Use BenchmarkDotNet and Compile YamlDotNet with Optimize option in Release-* configurations

Bug fixes

09 Oct 15:00
9b6c858
Compare
Choose a tag to compare
  • Fix roundtripping of tags on sequences (#347)

v5.2.0

09 Oct 14:59
Compare
Choose a tag to compare

Improvements:

v5.1.0

09 Oct 14:59
Compare
Choose a tag to compare

Improvements:

  • Add interfaces for serializer and deserializer (fixes #350).

Fixes:

  • Fixed issue #348 that caused the assembly to have version 0.0.0.0.