OneYaml 1.0.0
See the version list below for details.
dotnet add package OneYaml --version 1.0.0
NuGet\Install-Package OneYaml -Version 1.0.0
<PackageReference Include="OneYaml" Version="1.0.0" />
<PackageVersion Include="OneYaml" Version="1.0.0" />
<PackageReference Include="OneYaml" />
paket add OneYaml --version 1.0.0
#r "nuget: OneYaml, 1.0.0"
#:package OneYaml@1.0.0
#addin nuget:?package=OneYaml&version=1.0.0
#tool nuget:?package=OneYaml&version=1.0.0
OneYaml
Pure C# YAML 1.2 that edits a file and keeps its comments, with a System.Text.Json-style serializer.
YamlDocumentkeeps 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.YamlSerializerreads and writes .NET types withYamlSerializerOptions, 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.Untrustedadds 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
- README: benchmarks, conformance, when to use it and when not to
- Serializer, Editing, Patches, Limits
- Migrating from YamlDotNet or SharpYaml
- Changelog and security policy
Report problems at GitHub issues. Licensed under MIT or Apache-2.0, at your option.
| Product | Versions 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. |
-
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.