Skip to content

Commit

Permalink
Exclude null YAML serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeBiellik committed Dec 1, 2019
1 parent 256d56d commit b9138ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Configuration/Yaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static string Serialize(object obj)
.WithTypeConverter(new SteamIdConverter())
.WithTypeConverter(new TimeZoneInfoConverter())
.WithTypeConverter(new CultureInfoConverter())
//.EmitDefaults()
.ConfigureDefaultValuesHandling(DefaultValuesHandling.OmitNull)
.Build()
.Serialize(obj);
}
Expand All @@ -53,7 +53,6 @@ private static IDeserializer Deserializer()
return new DeserializerBuilder()
.WithNamingConvention(UnderscoredNamingConvention.Instance)
.WithTypeInspector(i => new BasePluginTypeInspector(i))
//.IgnoreUnmatchedProperties()
.WithTypeConverter(new NameConverter())
.WithTypeConverter(new TimeSpanConverter())
.WithTypeConverter(new VersionConverter())
Expand All @@ -62,6 +61,7 @@ private static IDeserializer Deserializer()
.WithTypeConverter(new SteamIdConverter())
.WithTypeConverter(new TimeZoneInfoConverter())
.WithTypeConverter(new CultureInfoConverter())
//.IgnoreUnmatchedProperties()
.Build();
}
}
Expand Down

0 comments on commit b9138ca

Please sign in to comment.