I have an Asp.Net web API 5.2 project in c# and generating documentation with Swashbuckle.
I have model that contain inheritance something like having an Animal prop
As of this merge into Swashbuckle.AspNetCore, you can get basic support for polymorphic schemas by using:
services.AddSwaggerGen(c =>
{
c.GeneratePolymorphicSchemas();
}
You can also express your derived types via attributes present in the Annotations library:
[SwaggerSubTypes(typeof(SubClass), Discriminator = "value")]
This article goes into further detail as to how you can deserialize derived types using Newtonsoft.