Spring Boot SwaggerUI with not working with latest version

Stack Overflow Asked on January 3, 2022

I am trying to add the Swagger UI in my Spring Boot Application, but I am unable to access the swagger-ui.html.





public class SwaggerConfig {

    public Docket api() {
        return new Docket(DocumentationType.SWAGGER_2).select()


@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, CassandraAutoConfiguration.class,
        KafkaAutoConfiguration.class })
public class SearchApp {

    public static void main(String[] args) {, args);

I am able to access the swagger resources:

    "name": "default",
    "url": "/v2/api-docs",
    "swaggerVersion": "2.0",
    "location": "/v2/api-docs"

  "deepLinking": true,
  "displayOperationId": false,
  "defaultModelsExpandDepth": 1,
  "defaultModelExpandDepth": 1,
  "defaultModelRendering": "example",
  "displayRequestDuration": false,
  "docExpansion": "none",
  "filter": false,
  "operationsSorter": "alpha",
  "showExtensions": false,
  "showCommonExtensions": false,
  "tagsSorter": "alpha",
  "validatorUrl": "",
  "supportedSubmitMethods": [
  "swaggerBaseUiUrl": ""

Please let me know if something has changed in the latest version, because I have been using the swagger-ui in my other projects.

2 Answers

You need to add this dependency also If using swagger 3 version.


Also, add @EnableOpenApi annotation in main class in Springboot application.

Hope this will work. Thanks!

Answered by vikrant_2020 on January 3, 2022

In 3.0.0 swagger-ui.html has been moved to swagger-ui/index.html

Answered by jmhostalet on January 3, 2022

Add your own answers!

Related Questions

R mutate multiple columns with ifelse

1  Asked on December 7, 2021 by qnp1521


How can I show the code of my program in the output in python?

2  Asked on December 7, 2021 by ayaan-singh-saundh


Can’t unzip file with php

3  Asked on December 7, 2021 by ciro-garca


why isn’t my local variable overwriting the global?

4  Asked on December 7, 2021 by pillow-study


Variable not assigned even though I assigned it (Android Java)

1  Asked on December 7, 2021 by ictwinner


Function to find string with only one emoji

1  Asked on December 7, 2021 by user1199595


How to group buttons on Google Closure editor?

1  Asked on December 7, 2021 by frenchcooc


Mark non db fields @Transient vs extent JPA Entity?

1  Asked on December 7, 2021 by bluelurker


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP