You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Hi, I'm trying to follow the tutorial here on how to deserialize multiple documents. I'm using YamlDotNet 13.7.0. I receive two warnings:
'ParserExtensions.Accept(IParser)' is obsolete: 'Please use TryConsume(out var evt) or Accept(out var evt) instead'
'ParserExtensions.Expect(IParser)' is obsolete: 'Please use Consume() instead'
When using recommended methods, the same code snippet does not emit the second document.
To Reproduce
// Consume the stream start event "manually"
parser.Consume<StreamStart>();
while (parser.TryConsume<DocumentStart>(out var @event))
{
// Deserialize the document
var doc = deserializer.Deserialize(parser);
var json = serializer.Serialize(doc);
}
Nevermind, I used Accept instead of TryConsume and it now works:
// Consume the stream start event "manually"
parser.Consume<StreamStart>();
while (parser.Accept<DocumentStart>(out var @event))
{
// Deserialize the document
var doc = deserializer.Deserialize(parser);
var json = serializer.Serialize(doc);
}
Thanks for pointing that out. I’ll get the docs updated soon. And probably mark those obsolete methods as hidden so the code doesn’t break but intellisense won’t show them.
Describe the bug
Hi, I'm trying to follow the tutorial here on how to deserialize multiple documents. I'm using YamlDotNet 13.7.0. I receive two warnings:
When using recommended methods, the same code snippet does not emit the second document.
To Reproduce
Sample yaml:
What am I missing here? Thanks!
The text was updated successfully, but these errors were encountered: