From de84c162bcb42edfe2552734dd09282442d62de3 Mon Sep 17 00:00:00 2001 From: filzrev <103790468+filzrev@users.noreply.github.com> Date: Mon, 21 Sep 2026 17:18:16 +0900 Subject: [PATCH] deps: update YamlDotNet version to 18..1.0 --- Directory.Packages.props | 2 +- .../TypeInspectors/ExtensibleTypeInspectorSkeleton.cs | 4 ++++ src/Docfx.YamlSerialization/YamlDeserializer.cs | 4 ++++ .../MergeMarkdownFragmentsTest.cs | 2 +- test/Docfx.Build.Tests/TocDocumentProcessorTest.cs | 2 +- 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index bd56eb6b5dc..9dc17b22ea3 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -19,7 +19,7 @@ - + diff --git a/src/Docfx.YamlSerialization/TypeInspectors/ExtensibleTypeInspectorSkeleton.cs b/src/Docfx.YamlSerialization/TypeInspectors/ExtensibleTypeInspectorSkeleton.cs index 715bec3a57f..83a0c777967 100644 --- a/src/Docfx.YamlSerialization/TypeInspectors/ExtensibleTypeInspectorSkeleton.cs +++ b/src/Docfx.YamlSerialization/TypeInspectors/ExtensibleTypeInspectorSkeleton.cs @@ -64,4 +64,8 @@ public IPropertyDescriptor GetProperty(Type type, object? container, string name public abstract string GetEnumName(Type enumType, string name); public abstract string GetEnumValue(object enumValue); + + public bool HasParseMethod(Type type) => false; + + public object? Parse(string value, Type expectedType) => throw new NotImplementedException(); } diff --git a/src/Docfx.YamlSerialization/YamlDeserializer.cs b/src/Docfx.YamlSerialization/YamlDeserializer.cs index 9080bea8fe5..fd3aa49eabe 100644 --- a/src/Docfx.YamlSerialization/YamlDeserializer.cs +++ b/src/Docfx.YamlSerialization/YamlDeserializer.cs @@ -65,6 +65,10 @@ public string GetEnumValue(object enumValue) { return TypeDescriptor.GetEnumValue(enumValue); } + + public bool HasParseMethod(Type type) => false; + + public object? Parse(string value, Type expectedType) => throw new NotImplementedException(); } public YamlDeserializer( diff --git a/test/Docfx.Build.SchemaDriven.Tests/MergeMarkdownFragmentsTest.cs b/test/Docfx.Build.SchemaDriven.Tests/MergeMarkdownFragmentsTest.cs index 15909a250f9..018d0e951d3 100644 --- a/test/Docfx.Build.SchemaDriven.Tests/MergeMarkdownFragmentsTest.cs +++ b/test/Docfx.Build.SchemaDriven.Tests/MergeMarkdownFragmentsTest.cs @@ -183,7 +183,7 @@ markdown content Assert.True(File.Exists(_rawModelFilePath)); var rawModel = JsonUtility.Deserialize(_rawModelFilePath); Assert.Single(warningLogs); - Assert.Equal("Unable to parse markdown fragments: Encountered an invalid YAML code block: (Line: 1, Col: 1, Idx: 0) - (Line: 1, Col: 28, Idx: 27): Exception during deserialization", warningLogs.First().Message); + Assert.StartsWith("Unable to parse markdown fragments: Encountered an invalid YAML code block: (Line: 1, Col: 1, Idx: 0) - (Line: 1, Col: 28, Idx: 27): ", warningLogs.First().Message); Assert.Equal("2", warningLogs.First().Line); Assert.Null(rawModel["summary"]); } diff --git a/test/Docfx.Build.Tests/TocDocumentProcessorTest.cs b/test/Docfx.Build.Tests/TocDocumentProcessorTest.cs index d15c1ecf083..6f1cdf64e7d 100644 --- a/test/Docfx.Build.Tests/TocDocumentProcessorTest.cs +++ b/test/Docfx.Build.Tests/TocDocumentProcessorTest.cs @@ -911,7 +911,7 @@ public void LoadBadTocYamlFileShouldGiveLineNumber() href: x2.md"; var toc = _fileCreator.CreateFile(content, FileType.YamlToc); var ex = Assert.Throws(() => TocHelper.LoadSingleToc(toc)); - Assert.Equal("toc.yml is not a valid TOC File: (Line: 3, Col: 10, Idx: 22) - (Line: 3, Col: 10, Idx: 22): While scanning a plain scalar value, found invalid mapping.", ex.Message); + Assert.StartsWith("toc.yml is not a valid TOC File: (Line: 3, Col: 10, Idx: 22) - (Line: 3, Col: 10, Idx: 22): ", ex.Message); } [Fact]