|
|
@@ -83,6 +83,12 @@ public sealed class YamlResourceCollection(
|
|
|
|
|
|
var serializer = new SerializerBuilder()
|
|
|
.WithNamingConvention(CamelCaseNamingConvention.Instance)
|
|
|
+ .WithTypeConverter(new StorageSizeYamlConverter())
|
|
|
+ .WithTypeConverter(new NotesStringYamlConverter())
|
|
|
+ .ConfigureDefaultValuesHandling(
|
|
|
+ DefaultValuesHandling.OmitNull |
|
|
|
+ DefaultValuesHandling.OmitEmptyCollections
|
|
|
+ )
|
|
|
.Build();
|
|
|
|
|
|
var payload = new OrderedDictionary
|
|
|
@@ -110,6 +116,8 @@ public sealed class YamlResourceCollection(
|
|
|
.WithNamingConvention(CamelCaseNamingConvention.Instance)
|
|
|
.WithCaseInsensitivePropertyMatching()
|
|
|
.WithTypeConverter(new StorageSizeYamlConverter())
|
|
|
+ .WithTypeConverter(new NotesStringYamlConverter())
|
|
|
+
|
|
|
.WithTypeDiscriminatingNodeDeserializer(options =>
|
|
|
{
|
|
|
options.AddKeyValueTypeDiscriminator<Resource>("kind", new Dictionary<string, Type>
|
|
|
@@ -163,6 +171,11 @@ public sealed class YamlResourceCollection(
|
|
|
|
|
|
var serializer = new SerializerBuilder()
|
|
|
.WithNamingConvention(CamelCaseNamingConvention.Instance)
|
|
|
+ .WithTypeConverter(new NotesStringYamlConverter())
|
|
|
+ .ConfigureDefaultValuesHandling(
|
|
|
+ DefaultValuesHandling.OmitNull |
|
|
|
+ DefaultValuesHandling.OmitEmptyCollections
|
|
|
+ )
|
|
|
.Build();
|
|
|
|
|
|
var yaml = serializer.Serialize(resource);
|