dotnet / docfx

Static site generator for .NET API documentation.
https://dotnet.github.io/docfx/
MIT License
3.94k stars 840 forks source link

chore: Fix exception thrown on TOC loading internally #9974

Open filzrev opened 1 month ago

filzrev commented 1 month ago

This PR is intended to fix internal exception that occurred when deserializing toc.yml file.

Current docfx implementation use YamlDeserializerWithFallback class to deserialize toc.yml file. And following operation executed.

  1. Try to deserialize yml as List<TocItemViewModel>.
  2. If YamlException is thrown. then deserialize as TocItemViewModel.

This PR intended to fix following problems.

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 86.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 78.81%. Comparing base (fe673ec) to head (9d56541). Report is 211 commits behind head on main.

Files Patch % Lines
src/Docfx.Build/TableOfContents/TocHelper.cs 86.66% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #9974 +/- ## ========================================== + Coverage 74.31% 78.81% +4.49% ========================================== Files 536 539 +3 Lines 23189 23440 +251 Branches 4056 4063 +7 ========================================== + Hits 17234 18474 +1240 + Misses 4853 3822 -1031 - Partials 1102 1144 +42 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.