Show HTTP request duration in Swagger UI

前端 未结 2 373
你的背包
你的背包 2021-01-06 12:05

Swagger UI has the displayRequestDuration parameter to show how long a request takes. It\'s disabled by default.

How can this be enabled in the SwaggerConfig.cs conf

2条回答
  •  耶瑟儿~
    2021-01-06 12:18

    In recent versions you can do

    app.UseSwaggerUi3(
        settings => settings.AdditionalSettings.Add("displayRequestDuration ", true));
    )
    
    

    since app.UseSwaggerUI is marked as obsolete.

    Tested with .NET Core 3.x.

提交回复
热议问题