Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Invalid documentation on type parameter #9755

Closed
bkoelman opened this issue Mar 3, 2024 · 1 comment · Fixed by #9806
Closed

[Bug] Invalid documentation on type parameter #9755

bkoelman opened this issue Mar 3, 2024 · 1 comment · Fixed by #9806
Labels
bug A bug to fix dotnet Generate .NET API reference docs

Comments

@bkoelman
Copy link

bkoelman commented Mar 3, 2024

Describe the bug
When a generic class contains a summary, but the type parameter is not documented, the summary text is shown for the type parameter.

To Reproduce

  1. Create a new project and add the following class:

    /// <summary>
    /// A visitor for tree nodes.
    /// </summary>
    public sealed class NodeVisitor<T>
    {
    }
  2. Follow the getting-started steps from the docfx documentation.

  3. Open the documentation website in the browser.

    image

Expected behavior
No documentation should be shown for the type parameter, because it is not documented. This worked properly in v2.74.0:

image

Context (please complete the following information):

  • OS: Windows 11
  • Docfx version: latest master (at commit 1d5e946)
  • .NET version: .NET 8
  • docfx.json config: default settings produced by docfx init
@bkoelman bkoelman added bug A bug to fix dotnet Generate .NET API reference docs labels Mar 3, 2024
@filzrev
Copy link
Contributor

filzrev commented Mar 5, 2024

This issue seems occurred from docfx v2.75.1

It can be fixed by adding following lines to [templates/common/ManagedReference.common.js] file. (https://github.com/dotnet/docfx/blob/main/templates/common/ManagedReference.common.js#L199-L207)

  if(vm.syntax.typeParameters) {
    vm.syntax.typeParameters.forEach(item => {
      item.description = item.description || "";
    });
  }

or explicitly assign empty string to Description property at ApiParameterBuildOutput.cs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug to fix dotnet Generate .NET API reference docs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants