OneYaml 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package OneYaml --version 1.0.0
                    
NuGet\Install-Package OneYaml -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OneYaml" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OneYaml" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="OneYaml" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OneYaml --version 1.0.0
                    
#r "nuget: OneYaml, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OneYaml@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OneYaml&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=OneYaml&version=1.0.0
                    
Install as a Cake Tool

OneYaml

Pure C# YAML 1.2 that edits a file and keeps its comments, with a System.Text.Json-style serializer.

  • YamlDocument keeps every byte you do not change. Indexers and RFC 6901 pointer methods write a new value in the style of the old one; JSON Patch (RFC 6902) and JSON Merge Patch (RFC 7396) apply atomically.
  • YamlSerializer reads and writes .NET types with YamlSerializerOptions, naming policies, converters, polymorphism and extension data. The System.Text.Json attributes are honoured where no YAML attribute is present. A source generator in this package covers trimmed and native AOT applications.
  • YAML 1.2 Core schema by default. Nesting, alias expansion and integer size are bounded by default; YamlLimits.Untrusted adds bounds for input you do not control.
  • No dependencies outside the .NET libraries. Targets .NET 8 and .NET 10.

Quick start

using OneYaml;

string src = """
    # Build settings
    script: |
      make build
    replicas: 2      # the CI job scales this
    """;

using var doc = YamlDocument.Parse(src);
doc.Set("/script", "make build\nmake test\n"); // still a block literal
doc.Root["replicas"] = 3;                      // only the 2 changes
Console.WriteLine(doc);
// # Build settings
// script: |
//   make build
//   make test
// replicas: 3      # the CI job scales this

var cfg = YamlSerializer.Deserialize<Config>(src)!;
Console.WriteLine($"{cfg.Replicas} replicas"); // 2 replicas

record Config(int Replicas, string Script);

Documentation

Report problems at GitHub issues. Licensed under MIT or Apache-2.0, at your option.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on OneYaml:

Package Downloads
RecursiveAI.OneGame.Server

The headless server host: fixed-step scopes, YAML configuration, logging, and the plugin API.

RecursiveAI.OneGame.Host

The game host: window, input, fixed-step simulation, UI and render stage for one game, windowed or headless.

RecursiveAI.OneGame.Testing

The C# test API: in-process clusters, scenarios, recordings and captures.

OneYaml.Compat.YamlDotNet

A compatibility adapter covering a subset of YamlDotNet's API (serializer builders and representation model), tested against YamlDotNet 18.1.0, running on OneYaml. Every difference is listed.

OneYaml.Compat.SharpYaml

A compatibility adapter covering a subset of the SharpYaml serializer API (YamlSerializer, YamlSerializerOptions, attributes), tested against SharpYaml 3.14.0, running on OneYaml. Every difference is listed.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.1 5,355 10/18/2026
1.2.0 188 10/18/2026
1.1.1 228 10/17/2026
1.1.0 164 10/17/2026
1.0.0 201 10/16/2026