I’m using the following versions:
spring-boot-starter-parent: 3.3.3
java.version: 21
spring-cloud-version: 2023.0.3
springdoc-openapi-starter-webmvc-ui: 2.6.0
When I run the application and try to access /swagger-ui/index.html, I receive a JSON response instead of the Swagger UI.
{"name":"swagger-ui","profiles":["index.html"],"label":null,"version":"d2592f45c32657d214294f6b030bef6003d0ee6d","state":null,"propertySources":[]}
And here is an example of my REST endpoint:
@RestController
@RequestMapping("/test/api/web-client")
public class WebClientResource {
@GetMapping("/greet")
public String greet() {
return "Hello World!";
}
}
And here are used dependencies in pom.xml
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-client</artifactId>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.6.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
1