3

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?

CDspace
  • 2,639
  • 18
  • 30
  • 36

1 Answers1

2

That is the correct way of using the DeserializerBuilder. The examples have not all been updated and some still use the old constructor.

Antoine Aubry
  • 12,203
  • 10
  • 45
  • 74