Swashbuckle Swagger UI:如何扩展到列表操作

时间:2017-06-09 16:01:10

标签: swagger swagger-ui

使用swagger配置。我知道它与docExpansion有关:list;但我不确定如何在SwaggerConfig文件中实例化该过程。

1 个答案:

答案 0 :(得分:0)

旧问题,但如果它帮助其他人使用Google搜索者,请回答。

如果要在Swagger UI中设置操作的初始扩展,请在SwaggerConfig.cs文件中找到' EnableSwaggerUi'您可以在其中添加/取消注释docExpansion设置。

例如:

.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);
         ...
相关问题