I am using Swagger 2 with Springfox.
When you click on an endpoint, is there any way to have the Try-it-out mode activated by default, without having to click this button:
try this: use on startup.cs (.net5) or program.cs (.net6)
app.UseSwaggerUI(options =>
{
options.EnableTryItOutByDefault();
});
You should set TRY_IT_OUT_ENABLED=true to enable "Try it out mode" by default.
So try to search this option for your UI swagger lib.
In my case I use @nestjs/swagger package so I used the following code to enable the mode:
SwaggerModule.setup(apiPrefix, app, document, {
swaggerOptions: {
tryItOutEnabled: true,
},
});
Also it works for swagger-ui package you can find its config here
For some swagger libs it does not work so try to update package version
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With