Releases: aaubry/YamlDotNet
Add support for (de)serialization of System.Type
v4.3.0 Merge branch 'type-serialization'
Cleanup the project
- 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)
- The currently supported platforms are now:
Bug fixes
Bug fixes
Bug fixes
Support .NET Core
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
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.
UseSerializerBuilder.WithTagMapping()
to register a new tag mapping on the serializer. -
Allow to unregister components from the SerializerBuilder and DeserializerBuilder.
Use theWithout...
methods onSerializerBuilder
andDeserializerBuilder
for that. -
- 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.
- It accepts
-
Improve the (de)serializer builders so that it is possible to wrap existing component registrations.
-
Added the
ApplyNamingConventions
property toYamlMemberAttribute
.
When this property is true, naming conventions are not applied to the associated member. This solves issue 228.
Bug fixes
- Fixed issue 189: extra '\0' after indentation indicators.
- Fixed some issues related to parsing and emitting comments.
- Fixed deserialization of ulongs greater than long.MaxValue.
- Fixed issue 218: Objects with custom type converters are traversed.
- Avoid crashing with a StackOverflowException when iterating over the AllNodes property when it's infinitely recursive.
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
This a major release that introduces a few breaking changes.
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.
New features
SerializerBuilder
andDeserializerBuilder
This is an important change that adds "builders" that can be used
to configure theSerializer
andDeserializer
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
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:
Bug fixes
- 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.
v3.9.0
Version 3.9.0
New features:
- Add YamlVisitorBase as an improved replacement for YamlVisitor
- YamlVisitor is now obsolete, and will be removed in a future release.
- Ensure compatibility with AOT compilation, for platforms that do not allow dynamic code generation, such as IOS or PS4.
- Add Yaml attribute overrides feature, similar to XML Serializer attribute overrides behavior.
- Add a YamlNodeType enumeration property to nodes.
Bug fixes:
- Fix #166 - Guid conversion to JSON is unquoted.
- Ignore enum value case during deserialization.
- Improve newline handling
- In some cases, consecutive newlines were incorrectly parsed or emitted.
- Fix #177 - double.MaxValue serialization.
- Register custom type converters with higher precedence than the built-in converters.
Fixes in handling of scalar
New features:
- Add support for different scalar integer bases.
Addresses issue #113. Adds basic support for deserializing scalar integers
written in binary, octal, decimal, hex, and base 60, as allowed in the YAML
specification; see http://yaml.org/type/int.html. Adds unit tests for each
of these bases as well. - Add dnx compatibility to the NuGet packages.
- Do not throw exception if a tag does not contain a valid type name.
Fixes and improvements:
- Cache type metadata.
- Fix wrong type when deserializing UInt16.
- Fix handling of special float values, such as NaN, PositiveInfinity and NegativeInfinity.
- Properly quote empty strings.
- Properly handle non-Unicode encodings when emitting scalars.