Is it possible to customize the generate Swagger documentation for ASP.NET CORE (C#)? Specifically, it seems to be changing the order properties are displayed in my model (i.e. it puts derived class properties first).
class BaseObj
{
string Username {get;set;}
string Password {get;set;}
}
class Obj2 : BaseObj
{
string SomeotherProp {get;set;}
}
Swagger generates:
SomeotherProp
Username
Password
I want SomeotherProp
to be at the bottom. I've tried using the Display(Order=1) attribute, but Swagger ignores that. I didn't see any hook in the configuration that I can custom sort.
IOperationFilter
andIDocumentFilter
. For actions/controller "display" you'd useIDocument
, to change stuff within the actions you use theIOperationFilter