25

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:

enter image description here

Thomas
  • 1,491
  • 13
  • 23
  • 5
    There is a ticket open to enable the development mode: https://github.com/swagger-api/swagger-ui/issues/2805 – Forethinker Sep 11 '19 at 00:47
  • 1
    According to [this issue](https://github.com/swagger-api/swagger-ui/issues/6528), the option is available with **Swagger 3** => [Demo](https://petstore.swagger.io/?tryItOutEnabled=true) – Thomas Sep 18 '21 at 13:51

1 Answers1

9

try this: use on startup.cs (.net5) or program.cs (.net6)

app.UseSwaggerUI(options =>
{       
    options.EnableTryItOutByDefault();
});
mattmanser
  • 5,719
  • 3
  • 38
  • 50
mohsen mashhadi
  • 201
  • 2
  • 8