We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I want new line as a key
"\n": xyz
but I always get something like this
? >2 : xyz
even if I emit scalar key with DoubleQuoted style, it's still complex key
DoubleQuoted
? "\n" : xyz
I think simple key can be multiline and this code should be deleted.
YamlDotNet/YamlDotNet/Core/Emitter.cs
Lines 1687 to 1690 in e32f92e
if
true
Lines 892 to 895 in e32f92e
The text was updated successfully, but these errors were encountered:
The following code illustrates the single line key not roundtripping as expected
using YamlDotNet.Serialization; var deserializer = new DeserializerBuilder().Build(); var serializer = new SerializerBuilder().Build(); var yaml = "\"\\n\": xyz"; var a = deserializer.Deserialize<object>(yaml); var b = serializer.Serialize(a); Console.WriteLine(yaml); Console.WriteLine("===="); Console.WriteLine(b); Console.WriteLine("===="); var c = deserializer.Deserialize<object>(b); var d = serializer.Serialize(c); Console.WriteLine(d); Console.WriteLine("===="); var e = new Test { Prop = "xyz" }; var f = serializer.Serialize(e); Console.WriteLine(f); Console.WriteLine("===="); public class Test { [YamlMember(Alias = "\n")] public string Prop { get; set; } }
Results:
"\n": xyz ==== ? >2 : xyz ==== '': xyz ==== ? ' ' : xyz ====
Sorry, something went wrong.
No branches or pull requests
I want new line as a key
but I always get something like this
even if I emit scalar key with
DoubleQuoted
style, it's still complex keyI think simple key can be multiline and this code should be deleted.
YamlDotNet/YamlDotNet/Core/Emitter.cs
Lines 1687 to 1690 in e32f92e
Otherwise this
if
will never betrue
.YamlDotNet/YamlDotNet/Core/Emitter.cs
Lines 892 to 895 in e32f92e
The text was updated successfully, but these errors were encountered: