Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<PackageVersion Include="Spectre.Console.Cli" Version="0.55.0" />
<PackageVersion Include="Stubble.Core" Version="1.10.8" />
<PackageVersion Include="System.Composition" Version="10.0.12" />
<PackageVersion Include="YamlDotNet" Version="16.3.0" />
<PackageVersion Include="YamlDotNet" Version="18.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
4 changes: 4 additions & 0 deletions src/Docfx.YamlSerialization/YamlDeserializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ markdown content
Assert.True(File.Exists(_rawModelFilePath));
var rawModel = JsonUtility.Deserialize<JObject>(_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"]);
}
Expand Down
2 changes: 1 addition & 1 deletion test/Docfx.Build.Tests/TocDocumentProcessorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ public void LoadBadTocYamlFileShouldGiveLineNumber()
href: x2.md";
var toc = _fileCreator.CreateFile(content, FileType.YamlToc);
var ex = Assert.Throws<DocumentException>(() => 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]
Expand Down
Loading