From bc97541e97114dc0fb987c7f22f23e5ae800857d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 24 Aug 2025 10:50:16 +0000 Subject: [PATCH 1/2] [deps] BRE: Update YamlDotNet to v16 --- util/Setup/Setup.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/Setup/Setup.csproj b/util/Setup/Setup.csproj index 6366d46d3d9e..39c3d0cc65f3 100644 --- a/util/Setup/Setup.csproj +++ b/util/Setup/Setup.csproj @@ -12,7 +12,7 @@ - + From a5c964b9cbd9316df73b7629097f7841a29f0bc9 Mon Sep 17 00:00:00 2001 From: Andreas Coroiu Date: Mon, 13 Oct 2025 16:56:13 +0200 Subject: [PATCH 2/2] fix: comment serialization in v16 --- util/Setup/YamlComments.cs | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/util/Setup/YamlComments.cs b/util/Setup/YamlComments.cs index cd5049534981..b19a82e396fb 100644 --- a/util/Setup/YamlComments.cs +++ b/util/Setup/YamlComments.cs @@ -21,6 +21,16 @@ public CommentGatheringTypeInspector(ITypeInspector innerTypeDescriptor) _innerTypeDescriptor = innerTypeDescriptor ?? throw new ArgumentNullException(nameof(innerTypeDescriptor)); } + public override string GetEnumName(Type enumType, string name) + { + return _innerTypeDescriptor.GetEnumName(enumType, name); + } + + public override string GetEnumValue(object enumValue) + { + return _innerTypeDescriptor.GetEnumValue(enumValue); + } + public override IEnumerable GetProperties(Type type, object container) { return _innerTypeDescriptor.GetProperties(type, container).Select(d => new CommentsPropertyDescriptor(d)); @@ -33,13 +43,19 @@ private sealed class CommentsPropertyDescriptor : IPropertyDescriptor public CommentsPropertyDescriptor(IPropertyDescriptor baseDescriptor) { _baseDescriptor = baseDescriptor; - Name = baseDescriptor.Name; } - public string Name { get; set; } - public int Order { get; set; } + public string Name => _baseDescriptor.Name; + public int Order + { + get => _baseDescriptor.Order; + set => _baseDescriptor.Order = value; + } public Type Type => _baseDescriptor.Type; public bool CanWrite => _baseDescriptor.CanWrite; + public bool AllowNulls => _baseDescriptor.AllowNulls; + public bool Required => _baseDescriptor.Required; + public Type ConverterType => _baseDescriptor.ConverterType; public Type TypeOverride { @@ -95,7 +111,7 @@ public class CommentsObjectGraphVisitor : ChainedObjectGraphVisitor public CommentsObjectGraphVisitor(IObjectGraphVisitor nextVisitor) : base(nextVisitor) { } - public override bool EnterMapping(IPropertyDescriptor key, IObjectDescriptor value, IEmitter context) + public override bool EnterMapping(IPropertyDescriptor key, IObjectDescriptor value, IEmitter context, ObjectSerializer serializer) { if (value is CommentsObjectDescriptor commentsDescriptor && commentsDescriptor.Comment != null) { @@ -105,6 +121,6 @@ public override bool EnterMapping(IPropertyDescriptor key, IObjectDescriptor val context.Emit(new Comment(comment, false)); } } - return base.EnterMapping(key, value, context); + return base.EnterMapping(key, value, context, serializer); } }