-
-
Notifications
You must be signed in to change notification settings - Fork 493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deserializing arbitrary YAML without creating types? #332
Comments
Sure, either deserialize to Deserializing as object: var deserializer = new DeserializerBuilder().Build();
var result = deserializer.Deserialize<object>(yaml); Using YamlStream: var stream = new YamlStream();
stream.Load(new StringReader(yaml));
// Read stream.Documents |
Id you deserialize to object, the following default types will be used:
|
Thanks! In this case the Does YamlDotNet provide any |
Exactly. Unless a node has a tag, the above types will be used depending on the node's type. If the node has a tag, you will need to register a tag mapping, indicating which .NET type corresponds to that tag. |
Is there an easy what to change the default type for mapping to |
Thank you, this is really useful information - is it documented anywhere? |
Is there a way to use YamlDotNet to deserialize YAML to raw strings, lists, or dictionaries when the structure of the YAML isn't known in advance and can be arbitrary? For example, is
ExpandoObject
a possibility?The text was updated successfully, but these errors were encountered: