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

Vimeo offline video playback issue

0  Asked on September 26, 2020 by ipatel


How to print data from a few arrays

3  Asked on September 25, 2020 by protodimbo


why this.key is not working properly in javacript?

2  Asked on September 25, 2020 by carlos-daniel


Pass the dynamic variable when button is pressed

1  Asked on September 19, 2020 by francy


detect a table part from entire image in python

5  Asked on September 19, 2020 by suji


C# Change number of decimals show, but it always skips a number

0  Asked on September 18, 2020 by theoverly


Custom font bold weight not working in Dompdf

1  Asked on September 17, 2020 by user13286


How to use has one through in laravel?

0  Asked on September 17, 2020 by ahz


Ask a Question

Get help from others!

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