Questions tagged [yamldotnet]

YamlDotNet is a .NET library for YAML

YamlDotNet provides low level parsing and emitting of YAML as well as a high level object model similar to XmlDocument. A serialization library is also included that allows to read and write objects from and to YAML streams.

The most up-to-date version can always be found right from Visual studio by installing following NuGet package - YamlDotNet.

PM> Install-Package YamlDotNet

Documentation can be found on the official page.

188 questions
0
votes
0 answers

How to serialize a tree of objects with YamlDotNet

I have the following class: public class MenuItem { public string Title { get; set; } public List Items { get; set; } public MenuItem() { Items = new List(); } } How it is possible to properly…
Tarniadi
  • 79
  • 1
  • 1
  • 4
0
votes
2 answers

parse comments in yaml

I have a requirement of parsing yaml documents including comments, my yaml file looks like this Prerequisite_Services: - Service_Name: abc Workflows: - Workflow: workflow1 Service: - Service_Name: abc1 - Service_Name: abc2 # - Service_Name:…
Prashant
  • 51
  • 9
0
votes
1 answer

oneway IEnumerable processing

I have huge source (some IEnumerable that goes through an IDbReader row by row), that I need to serialize to yaml and deserialize back.How can I avoid collecting all items in memory?
0
votes
0 answers

How to emit type tags when serializing with YamlDotNet?

If I add EnsureRoundtrip() as below, my serialization fails, because I have types without default constructors (which I intend to resolve via custom desrializers): var yaml = new SerializerBuilder() .EnsureRoundtrip() .Build() …
Tar
  • 8,529
  • 9
  • 56
  • 127
0
votes
0 answers

Processing a large dataset of nested data

I have a rather large set of data which is structured in a somewhat unique fashion. It looks something like this: foo: - name: "some name" location: "some location" type: "someType" bar: - name: "A bar element" location: "location…
incursio
  • 3
  • 4
0
votes
1 answer

Nested list in YAML file - having trouble with class creation in VB.net (eve online SDE)

I pretty new to the YAML format and VB.net in general (worked with VB6 for ~5 years at work and migrating over, this project is a bit of a learning exercise). I am also using the yamldotnet package. At the moment I am modifying some code that was…
Soupy
  • 1
  • 2
0
votes
1 answer

YamlDotNet - Parse properties in a Dictionary

I would like to parse the following YAML urls: who: /fr-fr/who-we-are test: /fr-fr/test targetDirectory: d:\temp Into the following structure: public class UserConfig { public Dictionary Urls { get; set; } public…
Kapoue
  • 847
  • 2
  • 11
  • 15
0
votes
1 answer

how to serialize a YamlDocument to yaml string

I use YamlDotnet and I have a YamlDocument. Now I want to convert it to his yaml text representation in memory but I don't see how to achieve that. var yaml = new YamlDocument(new YamlMappingNode()); yaml.Add("one", "other") var text =…
Dragouf
  • 4,676
  • 4
  • 48
  • 55
0
votes
1 answer

Is there a way to deserialize a specific property of a YAML document?

In JSON.Net I can read a JSON file into a data structure and then only convert the properties that I'm interested in to objects. For example, if I have a JSON file like { "Bob": { "Steve": 5 } } I can get the object…
reveazure
  • 653
  • 2
  • 7
  • 14
0
votes
1 answer

Deserializing a YAML file - Eve Online based

I have been struggling with something on and off for about a week now. I am creating a program that can take a .yaml and parse it into an object for manipulation and output. The issue I have is an error with the YAMLDotNet package, When it gets to…
Sambridg
  • 1
  • 1
0
votes
1 answer

C# Serialization Error of JObject to YamlDotNet

I opened a ticket here but am hoping that somebody can answer fairly simply. YamlDotNet doesn't support ISerializable, but Json.Net does. So, as a workaround we're trying to serialize our object to JObject first, which respects our serialization…
solvingJ
  • 1,321
  • 1
  • 19
  • 30
0
votes
0 answers

Convert yaml file to json

I'm trying to convert a yaml file to a json file with a C# application. My application crashed on the following row "created: !ruby/object:ActiveSupport::TimeWithZone" How can I convert the date, because I need this part: "2016-10-14…
Barry The Wizard
  • 1,258
  • 2
  • 12
  • 25
0
votes
1 answer

Support for multiple aliases in yamldotnet deserialization

I have a YAML document as: name: foo description: bar and another YAML document as: name: foo1 desc: bar1 I am using YamlDotNet YamlMember 'Alias' property to define the attribute name. But it lets me define only one alias. I want "description"…
0
votes
0 answers

Deserialize Object Hierarchy in YAMLDotNet

I am using YamlDotNet and it works pretty well. I have a quick question about serializing object trees though. For example, I have class A { [YamlMember(Alias = "p1")] public string P1 { get; set; } } Then I want to inherit from A like…
VJK
  • 33
  • 11
0
votes
1 answer

yaml to json conversion

During implementation of yaml to json converter for swagger schema I was faced with the problem: default setup of deserialization builder var deserializer = new DeserializerBuilder().Build() cannot recognize 'integer', 'boolean' types. The…
al__gol
  • 99
  • 7