When trying to use YamlDotNet, I run into this warning:
Deserializer.Deserializer(IObjectFactory, INamingConvention, bool, YamlAttributeOverrides) is obsolete: 'Please use DeserializerBuilder to customize the Deserializer. This constructor will be removed in future releases.'
So I go to the official project homepage:
And click the 'Deserializing an object graph' example, which leads me here: https://dotnetfiddle.net/HD2JXM
And, surprisingly, this too is using the obsolete function.
I fixed it by doing this:
DeserializerBuilder groupIDsDB = new DeserializerBuilder();
groupIDsDB.WithNamingConvention(new CamelCaseNamingConvention());
Deserializer groupIDsDeserializer = groupIDsDB.Build();
Instead of my earlier:
Deserializer groupIDsDeserializer = new Deserializer(namingConvention: new CamelCaseNamingConvention());
Is this correct?
That is the correct way of using the DeserializerBuilder. The examples have not all been updated and some still use the old constructor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With