Skip to content

v4.4.0

Latest

Choose a tag to compare

@axunonb axunonb released this 21 Mar 08:54
a5ffd35

Main changes

Line Ending Normalization in #277

The XML 1.0 specification (§2.11 End-of-Line Handling) requires compliant parsers to normalize CRLF (and any lone CR) to a single LF before parsing. This PR enforces consistent line endings across the repository by updating the .gitattributes configuration and re-normalizing all tracked files.

Before this change the serializer had no way to control the line ending output. The new default "\n" makes serialized output identical on Windows and Linux without callers having to think about it. Consumers who need OS-native line endings can opt in explicitly via Options.NewLineChars = Environment.NewLine.

Changes are non-breaking

The only observable behavioral difference is on Windows only, Serialize(object?) and SerializeToFile() previously produced \r\n line endings (because XmlWriterSettings.NewLineChars defaults to Environment.NewLine).

They now produce \n. Any consumer that parses the XML rather than doing raw string comparison is completely unaffected. The only scenario that could break is a test or assertion doing a literal string comparison against a hardcoded \r\n expected value.

How users can control line endings

a) Restore OS-native behaviour (CRLF on Windows):

var serializer = new YAXSerializer<MyClass>(new SerializerOptions
{
    NewLineChars = Environment.NewLine
});

b) Force CRLF regardless of platform:

var options = new SerializerOptions { NewLineChars = "\r\n" };

c) Force LF regardless of platform (the new default):

var options = new SerializerOptions { NewLineChars = "\n" };

Fixes

  • Fix dictionary deserialization with applied XML namespaces in #278
  • Fix: YAXCollectionSerializationTypes.RecursiveWithNoContainingElement for List (not Dictionary) only works if there are no sibling elements by @binki in #259

Other changes

  • Update nuget api key in #262
  • Update unit test packages in #264
  • Update Nuget API Key in #265
  • Update Windows runner version in SonarCloud.yml in #266
  • Ensure that unit tests succeed for YAXLib netstandard2.x target assets in #267
  • Migrate CI/CD from AppVeyor to GitHub in #268
  • Update dependencies in #269
  • Minor fixes to GitHub action workflows in #271
  • Use dotnet CLI for nuget pkg upload in #272
  • Enable Trusted Publishing on nuget.org in #275
  • chore: Update Assert.Multiple to Assert.EnterMultipleScope in unit tests in #279
  • chore: Update sonar workflow in #280
  • chore: Update test and build packages in #281
  • Bump v4.4.0 in #282

New Contributors

Full Changelog: v4.3.0...v4.4.0