unchase / Unchase.Swashbuckle.AspNetCore.Extensions

:hammer: A library contains a bunch of extensions (filters) for Swashbuckle.AspNetCore.
https://www.nuget.org/packages/Unchase.Swashbuckle.AspNetCore.Extensions
Apache License 2.0
115 stars 16 forks source link

Enum descriptions are only written to the type description text if all enum values have a description #27

Closed cremor closed 1 year ago

cremor commented 2 years ago

Enum descriptions (from XML comments or description attributes) are written to the description text of properties of that enum type. But that only works if all enum values have a description. As soon as a single enum value doesn't have a description any more, none of the values will have their description written any more.

Example: Works:

public enum TestEnum
{
    /// <summary>
    /// This is first
    /// </summary>
    First,

    /// <summary>
    /// This is second
    /// </summary>
    Second,

    /// <summary>
    /// This is third
    /// </summary>
    Third,
}

grafik

Doesn't work:

public enum TestEnum
{
    /// <summary>
    /// This is first
    /// </summary>
    First,

    /// <summary>
    /// This is second
    /// </summary>
    Second,

    Third,
}

grafik