0

I am using the following dependencies for Swagger:

implementation group: 'io.swagger.core.v3', name: 'swagger-annotations', version: '2.2.7'
implementation group: 'org.springdoc', name: 'springdoc-openapi-ui', version: '1.6.12'

My Swagger configuration code is as follows:

@Configuration
public class SwaggerConfig {

    @Bean
    public GroupedOpenApi publicApi() {
        return GroupedOpenApi.builder()
                .group("All Apis")
                .pathsToMatch("/api/v0/**")
                .build();
    }

    @Bean
    public OpenAPI springShopOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                .title("Kaim Tutorial API")
                .description("Kaim Tutorial All Apis.")
                .version("v0.0.1")
                .license(new License().name("Apache 2.0").url("http://springdoc.org")))
                .externalDocs(new ExternalDocumentation()
                .description("SpringShop Wiki Documentation")
                .url("https://springshop.wiki.github.org/docs"));
    }
}

What change do I need to make to show every API request duration time in Swagger UI?

I have checked other documentations but they are either for Swagger 2.0 or something that does not use OpenAPI.

Helen
  • 87,344
  • 17
  • 243
  • 314
  • 2
    You need Swagger UI option [displayRequestDuration: true](https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/configuration.md#user-content-displayrequestduration). Check Springdoc documentation to see if it has the corresponding config to enable this option. – Helen Jan 29 '23 at 11:10

0 Answers0