oneyaml articles
Guides to working with oneyaml: how-tos, migrations and comparisons.
-
Replacing YamlDotNet
Looking for a YamlDotNet alternative? What YamlDotNet does to a file you edit and save, the options, and a one-package swap that keeps your builder code.
-
yaml.v3 is archived: what to use instead
gopkg.in/yaml.v3 is archived and unmaintained. Four ways off it, from a one-line import change to a YAML 1.2 API, each with code run on the current release.
-
The YAML Norway problem
The YAML Norway problem explained: why country: NO reads as false, which Go, Rust and C# YAML libraries still do it, and how to read and write YAML safely.
-
YAML anchors, aliases and merge keys
YAML anchors and aliases explained: & and * syntax, << merge keys and their override rules, which Go, Rust and C# parsers merge by default, and safe edits.
-
serde_yaml is deprecated: what now
serde_yaml is archived and marked deprecated on crates.io. The maintained forks, the one-line Cargo rename, and moving to oneyaml with the same function names.
-
Choosing a Rust YAML crate
Rust YAML parser crates compared: serde_yaml is archived. Its forks, serde-saphyr, saphyr, yaml-rust2, yaml-edit and oneyaml, with status, license and code.
-
Apply a JSON Patch to a YAML file
Apply a JSON Patch (RFC 6902) to a YAML file without converting it to JSON, so comments, quotes and key order stay. Code in Go, Rust and C#, plus merge patches.
-
Choosing a Go YAML library
Golang YAML libraries compared: yaml.v3 is archived and v4 is a release candidate. What go.yaml.in, sigs.k8s.io/yaml, goccy/go-yaml and oneyaml each do.
-
Read YAML in Go without a struct
Read a YAML file in Go without defining a struct: unmarshal into map[string]any, read one value by path, walk unknown keys with line numbers, and write it back.
-
Edit YAML without losing comments
Edit a YAML file from code and keep its comments, blank lines and quotes. Why most YAML libraries drop them, and the same edit in Go, Rust and C# that doesn’t.
-
Choosing a C# YAML library
C# YAML parser libraries compared: YamlDotNet, SharpYaml, VYaml and OneYaml by license, targets, YAML version and API, with the same file read by each.
-
YAML in a C# native AOT app
YAML in a C# native AOT app: OneYaml’s built-in source generator, the trim warnings you get without it, and how YamlDotNet and SharpYaml do it.