xoofx / SharpYaml

SharpYaml is a .NET library for YAML compatible with CoreCLR

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SerializerSettings.DefaultStyle not working

yariker opened this issue · comments

The SerializerSettings.DefaultStyle property seems to have no effect. The following code still produces a block syntax (SharpYaml v1.6.5.0):

var serializer = new Serializer(new SerializerSettings { DefaultStyle = YamlStyle.Flow });
var text = serializer.Serialize(new { List = new List<int> { 1, 2, 3 }, Name = "Hello", Value = "World!" });
Console.WriteLine(text);
// Outputs:
// List:
//   - 1
//   - 2
//   - 3
// Name: Hello
// Value: World!

Any idea why?