Skip to content

Commit

Permalink
Make Yaml deserializer ignore non-existing fields
Browse files Browse the repository at this point in the history
  • Loading branch information
marticliment committed Jan 7, 2025
1 parent 0bfc3c2 commit 126141e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/UniGetUI/Pages/SoftwarePages/PackageBundlesPage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using UniGetUI.PackageEngine.Operations;
using UniGetUI.PackageEngine.PackageClasses;
using UniGetUI.Pages.DialogPages;
using YamlDotNet.Serialization;

namespace UniGetUI.Interface.SoftwarePages
{
Expand Down Expand Up @@ -604,8 +605,9 @@ public async Task AddFromBundle(string content, BundleFormatType format)
}
else if (format is BundleFormatType.YAML)
{
YamlDotNet.Serialization.IDeserializer deserializer =
new YamlDotNet.Serialization.DeserializerBuilder()
IDeserializer deserializer =
new DeserializerBuilder()
.IgnoreUnmatchedProperties()
.Build();
DeserializedData = await Task.Run(() => deserializer.Deserialize<SerializableBundle_v1>(content));
}
Expand Down

0 comments on commit 126141e

Please sign in to comment.