I was facing the same problem. Then resolved the issue by adding the appropriate version of springdoc-openapi-starter-webmvc-ui. You need to match the springdoc-openapi-starter-webmvc-ui version according to the Spring Boot version of your project. See the doc about this, https://springdoc.org/#what-is-the-compatibility-matrix-of-springdoc-openapi-with-spring-boot