YamlConvert 1.0.1
See the version list below for details.
dotnet add package YamlConvert --version 1.0.1
NuGet\Install-Package YamlConvert -Version 1.0.1
<PackageReference Include="YamlConvert" Version="1.0.1" />
paket add YamlConvert --version 1.0.1
#r "nuget: YamlConvert, 1.0.1"
// Install YamlConvert as a Cake Addin #addin nuget:?package=YamlConvert&version=1.0.1 // Install YamlConvert as a Cake Tool #tool nuget:?package=YamlConvert&version=1.0.1
YamlConvert
YamlConvert is a YamlDotNet extension library which makes it trivially easy to serialize objects to/from YAML honoring JSON.NET attributes
Json.Net attributes
If you have been using JSON.NET you probably already use JsonProperty/JsonIgnore annotations to make your serialization just right. Then you think "why not try this YAML thing...and discover that your JObjects blow up and your annotations are ignored.
This library fixes this by creating a object converter for yamldotnet which understands how to read and write JObject/JArray/JValue objects. Not only that, but it honors the JSON.NET attributes you have painstakingly created.
Installation
nuget install YamlConvert
YamlConvert
YamlConvert - exposes SerializeObject() and DeserializeObject() methods which work just like JsonConvert, but with YAML
// to serialize to yaml
var yaml = YamlConvert.SerializeObject(someObject);
// to load your object as a JToken
dynamic obj1 = YamlConvert.DeserializeObject(yaml);
// to load your object as a typed object
var obj2 = YamlConvert.DeserializeObject<MyTypedObject>(yaml);
JTokenYamlConverter
This is a type converter for reading and writing JToken objects. It's automatically used by YamlConvert, but you can add it to your own serializer definition by using
.WithTypeConverter(new JTokenYamlConverter())
Example:
var serializer = new SerializerBuilder()
.WithTypeConverter(new JTokenYamlConverter())
.Build();
var deserializer = new DeserializerBuilder()
.WithTypeConverter(new JTokenYamlConverter())
.Build();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Newtonsoft.Json (>= 13.0.1)
- YamlDotNet (>= 11.2.1)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on YamlConvert:
Package | Downloads |
---|---|
Crazor
Experimental library for creating Adaptive Cards. |
|
NeverTest
Library allows executing yaml based scenarios. |
|
Crazor.AI
Experimental library for creating Adaptive Cards using ASP.NET Blazor component .Razor templates. |
GitHub repositories
This package is not used by any popular GitHub repositories.