I would like to display the subtypes classes in swagger documentation. my code:
app.MapPost("/search", (BaseType t) =>
{
return $"property: {t.p1}";
});
public interface BaseType
{
public int p1 { get; set; }
}
public class SubTypeA : BaseType
{
public int p1 { get; set; }
}
public class SubTypeB : BaseType
{
public int p1 { get; set; }
}
I only see the BaseType schema. but not the subtypes schema. Please help :)
I used web api minimal template and enabled OpenAPI tool.