I\'m trying to adjust the \"displayName\" of the model being used in an automatically generated Swagger definition.
This will only affect the Swagger names, meaning the
(Accounts for .net core:)
I would combine the display attribute of the class with a custom swagger schema:
[DisplayName("NewCompany")]
public class Company
{
}
and then in Startup:
services.AddSwaggerGen(c =>
{
c.CustomSchemaIds(x => x.GetCustomAttributes().SingleOrDefault().DisplayName);
});
see also this answer