aaubry / YamlDotNet

YamlDotNet is a .NET library for YAML
MIT License
2.48k stars 466 forks source link

The serializer serialitzes wrong the string arrays #866

Closed Mrgaton closed 7 months ago

Mrgaton commented 7 months ago

var data = new DeserializerBuilder().WithNamingConvention(CamelCaseNamingConvention.Instance).Build().Deserialize<dynamic>(savedData);

Ive used that to deserialize a yalm file and modify his content and then re serialize it but for example the string arrays doesnt serealitze well

from:

scopes:
        - "openid"
        - "link"
        - "bong"
        - "item"
        - "lol"
        - "agent"
        - "offline_access"

to :

scopes:
        -   openid: "-   openid"
        -   link: "-   link"
        -   bong: "-   bong"
        -   item: "-   item"
        -   lol: "-   lol"
        -   agent: "-   agent"
        -   offline_access: "-   offline_access"
Mrgaton commented 7 months ago

to serialize it i use this:

new Serializer().Serialize(data)
Mrgaton commented 7 months ago

Ok nevermind

Mrgaton commented 7 months ago

i was using a homemade crappy function to add custom spaces and that what broke the array :C sory