-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Open
Labels
Description
I am using the latest version of the following dependencies:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.4.3</version>
<relativePath/>
</parent>
[...]
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>2.8.5</version>
</dependency>And the following configuration in application.yml
spring:
cloud:
gateway:
routes:
- id: legacy_proxy
uri: http://localhost:8000
predicates:
- Path=/**
filters:
- RewritePath=/(?<segment>.*), /legacy-app-1/${segment}
order: 1000I have a controller:
@RestController
@RequestMapping("/example")
public class ExampleController {
@GetMapping()
public String getString() {
return "test";
}
}When this application is running I can make requests to /example which hits the controller endpoint, and I can make requests to /some/other/path which proxies the request correctly to http://localhost:8000/legacy-app-1/some/other/path, but in this configuration I can not access /swagger-ui/index.html. Curiously not all Swagger endpoints are affected, I can access /v3/api-docs.
If I change to Path=/legacy/** then Swagger UI works correctly.
Any idea why the /swagger-ui/index.html path is affected like this?