Recursive AI
oneyamlC#Available

oneyaml for C#

Lossless, comment-preserving editing and a System.Text.Json-style serializer for YAML 1.2, in one .NET package.

dotnet add package OneYaml

A quick look

Edit a document in place, keeping its comments, block scalars and layout, then bind the same text to a record with the serializer.

Getting started
Program.csC#
// The lossless document: edit in place
using var doc = YamlDocument.Parse(src);
doc.Root["replicas"] = 3;
// Only the 2 changes; comments stay.
 
// Typed reads, as with System.Text.Json
var cfg = YamlSerializer.Deserialize<Config>(src);

The package

Go further