dotnet / dotnet/docfx

Bug: Attributes without constructor not documented

Open
#5,262 3 comments 0 reactions 0 assignees View on GitHub
dotnet dotnet: csharp
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 11m
Merged PRs (30d)
10

Description

**Operation System**: `Windows`

**DocFX Version Used**: 2.47.0

**Template used**: `default`

**Steps to Reproduce**:

1. Create a simple attribute and apply it (example below)
2. apply it to a class and run docfx > attribute is not documented.
3. Add empty constructor to the attribute
4. run docfx > attribute is now documented

V1 before constructor
```
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)]
public class PrivateApi : Attribute
{
}
```

v2 after adding constructor
```
[AttributeUsage(AttributeTargets.All, AllowMultiple = true, Inherited = false)]
public class PrivateApi : Attribute
{
public PrivateApi() : base()
{

}
}
```

**Expected Behavior**:

Attributes should be documented, even if they don't have a constructor.

**Actual Behavior**:

Attributes only get documented if they have a constructor.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.