Skip to content

IncludeNonPublicProperties() broken in 16.0.0 #952

@dsdante

Description

@dsdante

After updating from 15.3.0 to 16.0.0 the deserializer no longer sees private/internal/etc properties even when built with DeserializerBuilder.IncludeNonPublicProperties().

// Program.cs
using YamlDotNet.Serialization;

using StreamReader file = new("test.yaml");
var result = new DeserializerBuilder()
    .IncludeNonPublicProperties()
    .Build()
    .Deserialize<Test>(file);
Console.WriteLine(result.PublicValue);

class Test
{
    [YamlMember(Alias = "key")]
    private string YamlValue { get; set; } = null!;

    public string PublicValue => YamlValue;
}
# test.yaml
key: value

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions