SharpYaml icon indicating copy to clipboard operation
SharpYaml copied to clipboard

No longer can set Alias for property like this: [YamlMember(Alias = "$ref")]

Open BuzzyLizzy opened this issue 3 years ago • 1 comments

I switched over from YamlDotNet to SharpYaml to investigate shortcomings of YamlDotNet is improved, but I can no longer set the Alias for a property in an object I declared as I did with YamlDotNet, like this:

    public class MessageObjectRef : IMessageObject {
        [YamlMember(Alias = "$ref")]
        public string Ref { get; set; }
    }

BuzzyLizzy avatar Sep 16 '21 15:09 BuzzyLizzy

I don't know what is alias but YamlMember in SharpYaml has a ctor taking a string directly:

https://github.com/xoofx/SharpYaml/blob/b21523e90b4f85c695d7871a827dad61b048d803/src/SharpYaml/Serialization/YamlMemberAttribute.cs#L82-L85

xoofx avatar Sep 16 '21 16:09 xoofx