Search code examples
c#swaggerswashbuckle

swashbuckle webapi parameters are readonly. how to make them editable?


I have added swashbuckle for swagger documentation into existing .net 6 WEBAPI. To test API am not able to edit any parameter. how can we do this ?

followed below article,

https://medium.com/@jasminewith/adding-swagger-to-asp-net-core-mvc-web-api-project-263473ea02a8

how can I make parameters editable to test it?


Solution

  • You have to click the "Try it out" button in the upper right of the request you want to test in Swagger UI to enable editing of your parameters and submit requests.

    Alternatively, you can enable "Try it out" by default in your application's startup configuration so you don't have to click the button each time, e.g.:

    app.UseSwaggerUi3(s =>
    {
        s.AdditionalSettings.Add("tryItOutEnabled", true);
    });