I have an API in .NET6 with a swagger ui and it works like a charm, except it wont show summaries of complex types. E.g. I have two types (Just an shortened example not the actual code.):
public class Address
{
/// <summary>
/// Address details (street, house number)
/// </summary>
[MaxLength(100)]
public string Street { get; set; }
/// <summary>
/// The country (code and full name)
/// </summary>
public Country Country { get; set; }
...
}
public class Country
{
/// <summary>
/// Two-letter country code
/// </summary>
[StringLength(2, MinimumLength = 2)]
public string Code { get; set; }
/// <summary>
/// Name of the country
/// </summary>
public string Name { get; set; }
}
Those types will be shown in swagger but the Country in Address will not show the summary.
Part of Address with summary of Street showing
Part of Address with summary of Country missing
I'm already using:
builder.Services.AddSwaggerGen(c =>
{
c.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory,
$"{Assembly.GetExecutingAssembly().GetName().Name}.xml"));
});
and:
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
Also I did look the issue up but couldn't find any solutions that go beyond simple types (which do work, like shown above).
Any suggestions as to what I'm missing (or additional information I should provide), are welcome, thanks in advance.