Reputation: 2192
Using swagger config. I know it has something to do with docExpansion:list; but i'm not sure how to instantiate that process in the SwaggerConfig file.
Upvotes: 1
Views: 1309
Reputation: 81
Old question but answer in case it helps someone else using the googler.
If you want to set the initial expansion of operations in Swagger UI, in your SwaggerConfig.cs file, you should find 'EnableSwaggerUi' where you can add/uncomment the docExpansion setting.
For example:
.EnableSwaggerUi(c =>
{
...
// Use this option to control how the Operation listing is displayed.
// It can be set to "None" (default), "List" (shows operations for each resource),
// or "Full" (fully expanded: shows operations and their details).
c.DocExpansion(DocExpansion.Full);
...
Upvotes: 1