This page describes what SharpYaml can serialize/deserialize out of the box.
SharpYaml always supports:
nullThe built-in scalar converters support the following C# primitive types:
boolbyte, sbyteshort, ushortint, uintlong, ulongnint, nuintfloat, doubledecimalcharstringDateTime, DateTimeOffset (roundtrip/ISO-8601)DateOnly, TimeOnly (ISO-8601, available on .NET 6+)GuidTimeSpanHalf (available on .NET 5+)Int128, UInt128 (available on .NET 7+)T?)Integer parsing follows YAML 1.2 core conventions and supports:
1_000_0000xFF, 0o755, 0b1010+1, -1Floating-point parsing supports:
+/- .inf.nanCommon collection shapes are supported:
T[])List<T>HashSet<T> / ISet<T>IEnumerable<T> / IReadOnlyList<T> / IReadOnlyCollection<T> / IList<T> / ICollection<T>ImmutableArray<T>, ImmutableList<T>, ImmutableHashSet<T>Dictionary<string, TValue>, IDictionary<string, TValue>, IReadOnlyDictionary<string, TValue>Dictionary<TKey, TValue>, IDictionary<TKey, TValue>, IReadOnlyDictionary<TKey, TValue> (for example int, Guid, enums)For non-string dictionary keys, SharpYaml currently supports scalar mapping keys only (complex mapping keys are not supported).
For custom types, SharpYaml uses an object converter that maps members to mapping keys. You can control this with:
PropertyNamingPolicy)[JsonPropertyName], [YamlPropertyName])YamlConverter<T> and YamlConverterAttribute)